summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/typst-library/src/layout/flow.rs2
-rw-r--r--tests/ref/layout/place-float-columns.pngbin0 -> 106011 bytes
-rw-r--r--tests/typ/layout/place-float-columns.typ19
3 files changed, 20 insertions, 1 deletions
diff --git a/crates/typst-library/src/layout/flow.rs b/crates/typst-library/src/layout/flow.rs
index fe6e9398..802154a0 100644
--- a/crates/typst-library/src/layout/flow.rs
+++ b/crates/typst-library/src/layout/flow.rs
@@ -474,7 +474,7 @@ impl<'a> FlowLayouter<'a> {
}
}
}
- used.y += footnote_height;
+ used.y += footnote_height + float_top_height + float_bottom_height;
// Determine the size of the flow in this region depending on whether
// the region expands. Also account for fractional spacing and
diff --git a/tests/ref/layout/place-float-columns.png b/tests/ref/layout/place-float-columns.png
new file mode 100644
index 00000000..186b79d1
--- /dev/null
+++ b/tests/ref/layout/place-float-columns.png
Binary files differ
diff --git a/tests/typ/layout/place-float-columns.typ b/tests/typ/layout/place-float-columns.typ
new file mode 100644
index 00000000..0e5c6d0c
--- /dev/null
+++ b/tests/typ/layout/place-float-columns.typ
@@ -0,0 +1,19 @@
+// Test floats in columns.
+
+---
+#set page(height: 200pt, width: 300pt)
+#show: columns.with(2)
+
+= Introduction
+#figure(
+ placement: bottom,
+ caption: [A glacier],
+ image("/files/glacier.jpg", width: 50%),
+)
+#lorem(45)
+#figure(
+ placement: top,
+ caption: [A rectangle],
+ rect[Hello!],
+)
+#lorem(20)