diff options
author | bptato <nincsnevem662@gmail.com> | 2024-02-16 21:48:40 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2024-02-16 21:52:05 +0100 |
commit | 6604bd6dc1fd9ad110fc5ff1f01f3b8b4c787ed8 (patch) | |
tree | 5732b7d0fefe592517bcb1fdb00484fb2198cd38 /src/layout | |
parent | 4d24e52ecffe2fb34d88299e6fc20a2f2c1756b1 (diff) | |
download | chawan-6604bd6dc1fd9ad110fc5ff1f01f3b8b4c787ed8.tar.gz |
layout: only reset charwidth on non-word atoms
charwidth is specifically intended to represent the width of all characters until the current one, so resetting it for words makes no sense. Originally it was reset for all atoms *except* words; 9fdea97d simplified the code incorrectly (flipped the logic) and thus introduced a regression.
Diffstat (limited to 'src/layout')
-rw-r--r-- | src/layout/engine.nim | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/layout/engine.nim b/src/layout/engine.nim index a9dca1e6..967435b1 100644 --- a/src/layout/engine.nim +++ b/src/layout/engine.nim @@ -608,7 +608,7 @@ proc addAtom(ictx: var InlineContext, state: var InlineState, ictx.addSpacing(shift, ictx.cellheight) ictx.minwidth = max(ictx.minwidth, atom.minwidth) ictx.applyLineHeight(ictx.currentLine, state.computed) - if atom.t == INLINE_WORD: + if atom.t != INLINE_WORD: ictx.currentLine.charwidth = 0 ictx.currentLine.atoms.add(atom) state.fragment.atoms.add(atom) |