about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-03-26 20:55:03 +0100
committerbptato <nincsnevem662@gmail.com>2024-03-26 20:55:03 +0100
commit260cfd57fba47acd18a26770027afbd4432674f9 (patch)
tree18e4f7720f1a80663233ce7122f42408363214f4
parent0d1a11cea0fa48837f4ae1ca869e9b01e1f159f4 (diff)
downloadchawan-260cfd57fba47acd18a26770027afbd4432674f9.tar.gz
layout: fix another infinite loop
aaaaa

(this was even worse than the previous one, of course caused by the
fix...)
-rw-r--r--src/layout/engine.nim4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/layout/engine.nim b/src/layout/engine.nim
index ce792be0..79822cd0 100644
--- a/src/layout/engine.nim
+++ b/src/layout/engine.nim
@@ -664,9 +664,9 @@ proc addAtom(ictx: var InlineContext; state: var InlineState;
     shift = ictx.computeShift(state)
     # For floats: flush lines until we can place the atom.
     #TODO this is inefficient
-    ictx.applyLineHeight(ictx.currentLine, state.computed)
-    ictx.currentLine.lineheight = max(ictx.currentLine.lineheight, ictx.cellheight)
     while ictx.shouldWrap2(atom.size.w + shift):
+      ictx.applyLineHeight(ictx.currentLine, state.computed)
+      ictx.currentLine.lineheight = max(ictx.currentLine.lineheight, ictx.cellheight)
       ictx.finishLine(state, wrap = false, force = true)
       # Recompute on newline
       shift = ictx.computeShift(state)