summaryrefslogtreecommitdiff
path: root/library
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-05-23 15:30:28 +0200
committerLaurenz <laurmaedje@gmail.com>2023-05-23 15:30:28 +0200
commit363836a28e4c8877b7c5203ed4ce595a59731802 (patch)
tree0f376023f81e3db69a3c1641a0db4136a7b7d3a8 /library
parentf2193307c48055e54d4d1b5eca43bf0189699d40 (diff)
Fix layout panic in rounded rectangle
Fixes #1216 both by hardening the rounded rectangle against negative size and by ensuring that the negative size doesn't occur in the first place for this case.
Diffstat (limited to 'library')
-rw-r--r--library/src/layout/flow.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/library/src/layout/flow.rs b/library/src/layout/flow.rs
index a21f8142..5e01f51d 100644
--- a/library/src/layout/flow.rs
+++ b/library/src/layout/flow.rs
@@ -243,6 +243,11 @@ impl<'a> FlowLayouter<'a> {
block: &Content,
styles: StyleChain,
) -> SourceResult<()> {
+ // Skip directly if regino 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>() {