diff options
| author | bptato <nincsnevem662@gmail.com> | 2024-04-19 23:58:43 +0200 |
|---|---|---|
| committer | bptato <nincsnevem662@gmail.com> | 2024-04-20 00:00:31 +0200 |
| commit | 503925d2c91e967d51354e322daec4feb62e7ff7 (patch) | |
| tree | ec54cb6a735178ad0991569f19f4cc1d6596852d | |
| parent | 485fff96292f737879c92973ca3c06755f95ffdf (diff) | |
| download | chawan-503925d2c91e967d51354e322daec4feb62e7ff7.tar.gz | |
layout: fix a list style positioning bug
If we are going to move out the child's offset, then we must also tell
the child where it starts so it can behave correctly when it encounters
exclusions.
| -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 3cfaf10f..aafa703d 100644 --- a/src/layout/engine.nim +++ b/src/layout/engine.nim @@ -1364,7 +1364,7 @@ proc layoutListItem(bctx: var BlockContext; box: BlockBox; let innerBox = BlockBox( computed: builder.content.computed, node: builder.node, - offset: Offset(x: sizes.margin.left), + offset: box.offset, margin: sizes.margin ) bctx.layoutFlow(innerBox, builder.content, sizes) @@ -1388,7 +1388,7 @@ proc layoutListItem(bctx: var BlockContext; box: BlockBox; box.firstBaseline = innerBox.firstBaseline box.size = innerBox.size # move innerBox margin & offset to outer box - box.offset += innerBox.offset + box.offset = innerBox.offset box.margin = innerBox.margin innerBox.offset = Offset() innerBox.margin = RelativeRect() |