diff options
author | bptato <nincsnevem662@gmail.com> | 2023-07-25 22:42:10 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-07-25 22:42:10 +0200 |
commit | a34b8590268f91cd76a4a1a2c7aab92d5060e53b (patch) | |
tree | 0cf8e799b2f74e3e973925d0e4b74e4f901072a5 /src | |
parent | dcec174b2af3af816180772f948575f896d58d20 (diff) | |
download | chawan-a34b8590268f91cd76a4a1a2c7aab92d5060e53b.tar.gz |
layout: fix position: relative sizes
Only inherit width from the last positioned element if position: absolute is set.
Diffstat (limited to 'src')
-rw-r--r-- | src/layout/engine.nim | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/layout/engine.nim b/src/layout/engine.nim index ac164ff3..9f4f8cb1 100644 --- a/src/layout/engine.nim +++ b/src/layout/engine.nim @@ -623,12 +623,12 @@ func toPercSize(sc: SizeConstraint): Option[LayoutUnit] = return none(LayoutUnit) func getParentWidth(box, parent: BlockBox): SizeConstraint = - if box.positioned: + if box.computed{"position"} == POSITION_ABSOLUTE: return parent.viewport.positioned[^1].availableWidth return parent.availableWidth func getParentHeight(box, parent: BlockBox): SizeConstraint = - if box.positioned: + if box.computed{"position"} == POSITION_ABSOLUTE: return parent.viewport.positioned[^1].availableHeight return parent.availableHeight |