diff options
author | bptato <nincsnevem662@gmail.com> | 2022-12-25 17:17:10 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2022-12-25 17:18:33 +0100 |
commit | 2b940385bf4765450f3666850b5f56930a5c4bf9 (patch) | |
tree | 1c371cee5936e3e40bec11d58a3cd7beb4fb302d /src/layout | |
parent | 412dafe1327d64793a9fb66814211db4a6c4ced2 (diff) | |
download | chawan-2b940385bf4765450f3666850b5f56930a5c4bf9.tar.gz |
layout/engine: use spec in positionBlocks
Diffstat (limited to 'src/layout')
-rw-r--r-- | src/layout/engine.nim | 5 |
1 files changed, 2 insertions, 3 deletions
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: |