diff options
author | bptato <nincsnevem662@gmail.com> | 2021-11-15 21:03:19 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2021-11-15 21:03:19 +0100 |
commit | d3d9139dd6aa535ed1d7f2c78accd6ac5fa89b3e (patch) | |
tree | 3f21c217de6f8d616d6d455c5f7da2511bff0664 /src/layout | |
parent | 9b95435ae6a859f5da69d2fc473099df5102e243 (diff) | |
download | chawan-d3d9139dd6aa535ed1d7f2c78accd6ac5fa89b3e.tar.gz |
Abstract away FlexibleCell, fix pageUp/pageDown
Diffstat (limited to 'src/layout')
-rw-r--r-- | src/layout/engine.nim | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/layout/engine.nim b/src/layout/engine.nim index 7b82cdf9..17cce41c 100644 --- a/src/layout/engine.nim +++ b/src/layout/engine.nim @@ -84,11 +84,9 @@ proc processInlineBox(parent: CSSBox, str: string): CSSBox = rowbox.setup(ibox.cssvalues, ibox.bcontext.nodes) var r: Rune while i < str.len: - fastRuneAt(str, i, r) - if rowbox.width + r.width() > ibox.width: - inlineWrap(ibox, rowi, fromx, rowbox) - if r != Rune(0x00A0) and #NBSP - r.isWhitespace(): + case str[i] + of ' ', '\n', '\t': + inc i let wsr = ibox.cssvalues[PROPERTY_WHITESPACE].whitespace if ibox.context.whitespace: if ibox.context.ws_initial: @@ -114,6 +112,10 @@ proc processInlineBox(parent: CSSBox, str: string): CSSBox = ibox.context.whitespace = false else: ibox.context.whitespace = false + fastRuneAt(str, i, r) + if rowbox.width + r.width() > ibox.width: + inlineWrap(ibox, rowi, fromx, rowbox) + rowbox.width += r.width() rowbox.runes.add(r) if rowbox.runes.len > 0: |