summaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
Diffstat (limited to 'render')
-rw-r--r--render/layout.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/render/layout.c b/render/layout.c
index fb21c10f3..371228297 100644
--- a/render/layout.c
+++ b/render/layout.c
@@ -738,8 +738,9 @@ void layout_find_dimensions(int available_width,
style);
break;
case CSS_WIDTH_PERCENT:
- *width = 0.5 + (available_width *
- style->width.value.percent / 100.0);
+ /* Round to nearest pixel */
+ *width = (style->width.value.percent *
+ available_width + 50) / 100;
/* gadget widths include margins,
* borders and padding */
if (box->gadget) {