diff options
| -rw-r--r-- | library/src/layout/flow.rs | 8 | ||||
| -rw-r--r-- | tests/ref/bugs/place-pagebreak.png | bin | 0 -> 978 bytes | |||
| -rw-r--r-- | tests/typ/bugs/place-pagebreak.typ | 7 |
3 files changed, 10 insertions, 5 deletions
diff --git a/library/src/layout/flow.rs b/library/src/layout/flow.rs index 69807320..cd713c68 100644 --- a/library/src/layout/flow.rs +++ b/library/src/layout/flow.rs @@ -243,11 +243,6 @@ impl<'a> FlowLayouter<'a> { block: &Content, styles: StyleChain, ) -> SourceResult<()> { - // Skip directly if region is already full. - if self.regions.is_full() { - self.finish_region()?; - } - // Placed elements that are out of flow produce placed items which // aren't aligned later. if let Some(placed) = block.to::<PlaceElem>() { @@ -256,6 +251,9 @@ impl<'a> FlowLayouter<'a> { self.layout_item(vt, FlowItem::Placed(frame))?; return Ok(()); } + } else if self.regions.is_full() { + // Skip directly if region is already full. + self.finish_region()?; } // How to align the block. diff --git a/tests/ref/bugs/place-pagebreak.png b/tests/ref/bugs/place-pagebreak.png Binary files differnew file mode 100644 index 00000000..2aa3d6b0 --- /dev/null +++ b/tests/ref/bugs/place-pagebreak.png diff --git a/tests/typ/bugs/place-pagebreak.typ b/tests/typ/bugs/place-pagebreak.typ new file mode 100644 index 00000000..bc04af1a --- /dev/null +++ b/tests/typ/bugs/place-pagebreak.typ @@ -0,0 +1,7 @@ +// Test placing on an already full page. +// It shouldn't result in a page break. + +--- +#set page(height: 40pt) +#block(height: 100%) +#place(bottom + right)[Hello world] |
