From 69f607d94130ca3269cffd3de24e2069fdab7b03 Mon Sep 17 00:00:00 2001 From: bptato Date: Sat, 13 May 2023 19:53:46 +0200 Subject: layout: disregard negative underflow --- src/layout/engine.nim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/layout') diff --git a/src/layout/engine.nim b/src/layout/engine.nim index db7a9854..d2aa09a9 100644 --- a/src/layout/engine.nim +++ b/src/layout/engine.nim @@ -393,7 +393,7 @@ proc resolveContentWidth(box: BlockBox, widthpx, availableWidth: int, isauto = f box.contentWidth = underflow else: box.margin_right += underflow - else: + elif underflow > 0: if not computed{"margin-left"}.auto and not computed{"margin-right"}.auto: box.margin_right += underflow elif not computed{"margin-left"}.auto and computed{"margin-right"}.auto: @@ -429,6 +429,7 @@ proc resolveDimensions(box: BlockBox, availableWidth: int, availableHeight: Opti box.contentWidth = widthpx box.max_width = some(widthpx) box.min_width = some(widthpx) + eprint "resolve", computed{"width"} box.resolveContentWidth(widthpx, availableWidth, computed{"width"}.auto) if not computed{"max-width"}.auto: let max_width = computed{"max-width"}.px(viewport, availableWidth) -- cgit 1.4.1-2-gfad0 a> log blame commit diff stats
path: root/test/testdir/zerobytes
blob: e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 (plain) (tree)