diff options
author | bptato <nincsnevem662@gmail.com> | 2022-11-27 15:44:42 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2022-11-27 15:44:42 +0100 |
commit | 3a12afa7617f3ccecbbf6b5852da3d6382a412bb (patch) | |
tree | 7596ce7f667b9dabec6ec71c9bd05b9de67feb93 /src/layout | |
parent | e7f157c792f53cb084e8694ee608f00727432a3d (diff) | |
download | chawan-3a12afa7617f3ccecbbf6b5852da3d6382a412bb.tar.gz |
Fix some regressions, add loading progress bar
Diffstat (limited to 'src/layout')
-rw-r--r-- | src/layout/engine.nim | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/layout/engine.nim b/src/layout/engine.nim index d1ce9f27..408c3b70 100644 --- a/src/layout/engine.nim +++ b/src/layout/engine.nim @@ -83,7 +83,7 @@ proc horizontalAlignLine(ictx: InlineContext, line: LineBox, computed: CSSComput let x = max(maxwidth, line.width) - line.width for atom in line.atoms: atom.offset.x += x - of TEXT_ALIGN_CENTER: + of TEXT_ALIGN_CENTER, TEXT_ALIGN_CHA_CENTER: let x = max((max(maxwidth - line.offset.x, line.width)) div 2 - line.width div 2, 0) for atom in line.atoms: atom.offset.x += x @@ -107,8 +107,6 @@ proc horizontalAlignLine(ictx: InlineContext, line: LineBox, computed: CSSComput let atom = InlineSpacing(atom) atom.width = spacingwidth line.width += atom.width - else: - discard # Align atoms (inline boxes, text, etc.) vertically inside the line. proc verticalAlignLine(ictx: InlineContext) = @@ -686,7 +684,6 @@ iterator rows(builder: TableBoxBuilder): BoxBuilder {.inline.} = var body: seq[TableRowBoxBuilder] var footer: seq[TableRowBoxBuilder] var caption: TableCaptionBoxBuilder - #TODO this should be done for child in builder.children: assert child.computed{"display"} in ProperTableChild, $child.computed{"display"} case child.computed{"display"} @@ -708,7 +705,8 @@ iterator rows(builder: TableBoxBuilder): BoxBuilder {.inline.} = if caption == nil: caption = TableCaptionBoxBuilder(child) else: discard - yield caption + if caption != nil: + yield caption for child in header: yield child for child in body: |