summaryrefslogtreecommitdiff
path: root/render/layout.c
diff options
context:
space:
mode:
Diffstat (limited to 'render/layout.c')
-rw-r--r--render/layout.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/render/layout.c b/render/layout.c
index fc21ef284..f8f7e16ed 100644
--- a/render/layout.c
+++ b/render/layout.c
@@ -365,8 +365,8 @@ bool layout_block_context(struct box *block, int viewport_height,
* floats. */
int x0, x1, top;
struct box *left, *right;
- top = cy > y ? cy : y;
- top += max_pos_margin - max_neg_margin;
+ top = cy + max_pos_margin - max_neg_margin;
+ top = (top > y) ? top : y;
x0 = cx;
x1 = cx + box->parent->width -
box->parent->padding[LEFT] -