chiark
/
gitweb
/
~cjwatson
/
blog.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e5ac876
)
m.images: we don't need 1000 bits of precision for image grid.
author
Vladimír Vondruš
<mosra@centrum.cz>
Thu, 14 Sep 2017 22:05:43 +0000
(
00:05
+0200)
committer
Vladimír Vondruš
<mosra@centrum.cz>
Thu, 14 Sep 2017 22:11:11 +0000
(
00:11
+0200)
Limit the image width percentage to 3 decimal points. More than enough.
pelican-plugins/m/images.py
patch
|
blob
|
history
diff --git
a/pelican-plugins/m/images.py
b/pelican-plugins/m/images.py
index d61b4e08d731127bd43ff63c83124ee1c39eb518..ce57f933b7aa55a5f75d039a9694d5c73f5b42ec 100644
(file)
--- 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)