From: Vladimír Vondruš Date: Thu, 14 Sep 2017 22:05:43 +0000 (+0200) Subject: m.images: we don't need 1000 bits of precision for image grid. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=318b775cbc1bdb7cd607d535cd4fe3cd042ac6c6;p=blog.git m.images: we don't need 1000 bits of precision for image grid. Limit the image width percentage to 3 decimal points. More than enough. --- diff --git a/pelican-plugins/m/images.py b/pelican-plugins/m/images.py index d61b4e08..ce57f933 100644 --- a/pelican-plugins/m/images.py +++ b/pelican-plugins/m/images.py @@ -174,7 +174,7 @@ class ImageGrid(rst.Directive): link_node = nodes.reference('', refuri=image_reference) link_node.append(image_node) link_node.append(overlay_node) - wrapper_node = nodes.figure(width="{}%".format(image[1]*100.0/total_widths[image[2]])) + wrapper_node = nodes.figure(width="{:.3f}%".format(image[1]*100.0/total_widths[image[2]])) wrapper_node.append(link_node) grid_node.append(wrapper_node)