From 6604bd6dc1fd9ad110fc5ff1f01f3b8b4c787ed8 Mon Sep 17 00:00:00 2001 From: bptato Date: Fri, 16 Feb 2024 21:48:40 +0100 Subject: 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. --- src/layout/engine.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/layout/engine.nim') 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) -- cgit 1.4.1-2-gfad0