From 041219b67de28fd7d18daa6b17f85d625108d8f3 Mon Sep 17 00:00:00 2001 From: bptato Date: Sun, 25 Dec 2022 21:42:48 +0100 Subject: Fix an anonymous table bug ...by flushing anonymous tables *before* inline layout is set (therefore avoiding placing them inside inline boxes.) --- src/layout/engine.nim | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/layout/engine.nim b/src/layout/engine.nim index 813400b4..45662888 100644 --- a/src/layout/engine.nim +++ b/src/layout/engine.nim @@ -1444,13 +1444,19 @@ proc generateBlockBox(styledNode: StyledNode, viewport: Viewport, marker = none( ctx.generateInnerBlockBox() + # Flush anonymous tables here, to avoid setting inline layout with tables. + ctx.flushTableRow() + ctx.flushTable() + # (flush here, because why not) + ctx.flushInherit() + # Avoid unnecessary anonymous block boxes. This also helps set our layout to # inline even if no inner anonymous block was generated. if box.children.len == 0: box.children = ctx.blockgroup.boxes box.inlinelayout = true ctx.blockgroup.boxes.setLen(0) - ctx.flush() + ctx.blockgroup.flush() return box proc generateTableCellBox(styledNode: StyledNode, viewport: Viewport, parent: var InnerBlockContext): TableCellBoxBuilder = -- cgit 1.4.1-2-gfad0 f984'>refs log blame commit diff stats
path: root/compiler/semexprs.nim
blob: 623af97848c3f893b8ea6968ea80f47ef0eb8258 (plain) (tree)
1
2
3
4
5
6
7
8
9