diff options
author | bptato <nincsnevem662@gmail.com> | 2022-02-12 12:49:26 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2022-02-12 12:59:10 +0100 |
commit | 8544e90b85e50e9ae01950c47f7102b8d33242a4 (patch) | |
tree | 07a57602c513d330efb5a61f2bfb0f819c155ba0 /src/layout/engine.nim | |
parent | 58dfe2c7ae31406815fc29cdc0a00409b4155338 (diff) | |
download | chawan-8544e90b85e50e9ae01950c47f7102b8d33242a4.tar.gz |
Fix list item marker hack
Diffstat (limited to 'src/layout/engine.nim')
-rw-r--r-- | src/layout/engine.nim | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/layout/engine.nim b/src/layout/engine.nim index b9af3e6b..5d3d2fba 100644 --- a/src/layout/engine.nim +++ b/src/layout/engine.nim @@ -449,14 +449,18 @@ proc alignInlineBlock(bctx: BlockContext, box: InlineBlockBox) = box.ictx.whitespacenum = 0 # ew. +#TODO get rid of this hack proc alignMarkerOutside(bctx: BlockContext, box: MarkerBox) = let oldwidth = box.ictx.thisrow.width let oldheight = box.ictx.thisrow.height + let oldrow = box.ictx.thisrow assert box.text.len == 1 assert box.children.len == 0 box.ictx.renderText(box.text[0], bctx.compwidth, box.specified, box.node) - # We assume this renders one row only. But there's no guarantee it does... + + box.ictx.thisrow = oldrow # If wrapped... + if box.ictx.thisrow.atoms.len > 0: let atom = box.ictx.thisrow.atoms[^1] atom.relx -= atom.width @@ -468,9 +472,9 @@ proc alignMarkerOutside(bctx: BlockContext, box: MarkerBox) = if ws != atom: atom.relx -= ws.width - box.ictx.thisrow.width = oldwidth - box.ictx.height -= box.ictx.thisrow.height - oldheight - box.ictx.thisrow.height = oldheight + box.ictx.height = -1 #TODO I'm not even sure why this works + box.ictx.thisrow.width = oldwidth + box.ictx.thisrow.height = oldheight proc alignInline(bctx: BlockContext, box: InlineBox) = assert box.ictx != nil |