mirror of
https://github.com/typst/typst
synced 2025-05-14 17:15:28 +08:00
Fix non-terminating loop in flow layout (#3652)
This commit is contained in:
parent
28012b2f8d
commit
7c61ccac71
@ -257,9 +257,15 @@ impl<'a> FlowLayouter<'a> {
|
|||||||
|
|
||||||
let carry: Vec<_> = self.items.drain(sticky..).collect();
|
let carry: Vec<_> = self.items.drain(sticky..).collect();
|
||||||
self.finish_region(engine, false)?;
|
self.finish_region(engine, false)?;
|
||||||
|
let in_last = self.regions.in_last();
|
||||||
|
|
||||||
for item in carry {
|
for item in carry {
|
||||||
self.layout_item(engine, item)?;
|
self.layout_item(engine, item)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if in_last {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BIN
tests/ref/bugs/3641-float-loop.png
Normal file
BIN
tests/ref/bugs/3641-float-loop.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.8 KiB |
11
tests/typ/bugs/3641-float-loop.typ
Normal file
11
tests/typ/bugs/3641-float-loop.typ
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
// Flow layout should terminate!
|
||||||
|
// https://github.com/typst/typst/issues/3641
|
||||||
|
//
|
||||||
|
// This is not yet ideal: The heading should not move to the second page, but
|
||||||
|
// that's a separate bug and not a regression.
|
||||||
|
|
||||||
|
---
|
||||||
|
#set page(height: 40pt)
|
||||||
|
|
||||||
|
= Heading
|
||||||
|
#lorem(6)
|
Loading…
x
Reference in New Issue
Block a user