From 2b940385bf4765450f3666850b5f56930a5c4bf9 Mon Sep 17 00:00:00 2001 From: bptato Date: Sun, 25 Dec 2022 17:17:10 +0100 Subject: layout/engine: use spec in positionBlocks --- src/layout/engine.nim | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/layout/engine.nim b/src/layout/engine.nim index fd4f4a1d..aa0567bb 100644 --- a/src/layout/engine.nim +++ b/src/layout/engine.nim @@ -709,14 +709,13 @@ proc positionBlocks(box: BlockBox) = template apply_child(child: BlockBox) = child.offset.y = y child.offset.x = x - case - box.computed{"text-align"} + case box.computed{"text-align"} of TEXT_ALIGN_CHA_CENTER: child.offset.x -= child.width div 2 of TEXT_ALIGN_CHA_LEFT: discard of TEXT_ALIGN_CHA_RIGHT: child.offset.x -= child.width - elif not child.computed{"width"}.auto and child.contentWidth < box.contentWidth: + elif spec and child.contentWidth < box.contentWidth: let margin_left = child.computed{"margin-left"} let margin_right = child.computed{"margin-right"} if margin_left.auto and margin_right.auto: -- cgit