mirror of
https://github.com/typst/typst
synced 2025-05-15 01:25:28 +08:00
parent
d3b4d7da9a
commit
6720d8c301
@ -293,7 +293,7 @@ impl<'a, 'v> GridLayouter<'a, 'v> {
|
|||||||
for y in 0..self.rows.len() {
|
for y in 0..self.rows.len() {
|
||||||
// Skip to next region if current one is full, but only for content
|
// Skip to next region if current one is full, but only for content
|
||||||
// rows, not for gutter rows.
|
// rows, not for gutter rows.
|
||||||
if y % 2 == 0 && self.regions.is_full() {
|
if self.regions.is_full() && (!self.has_gutter || y % 2 == 0) {
|
||||||
self.finish_region()?;
|
self.finish_region()?;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -547,7 +547,7 @@ impl<'a, 'v> GridLayouter<'a, 'v> {
|
|||||||
self.finish_region()?;
|
self.finish_region()?;
|
||||||
|
|
||||||
// Don't skip multiple regions for gutter and don't push a row.
|
// Don't skip multiple regions for gutter and don't push a row.
|
||||||
if y % 2 == 1 {
|
if self.has_gutter && y % 2 == 1 {
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -222,8 +222,8 @@ impl Layout for TableElem {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Turn an iterator extents into an iterator of offsets before, in between, and
|
/// Turn an iterator of extents into an iterator of offsets before, in between,
|
||||||
/// after the extents, e.g. [10mm, 5mm] -> [0mm, 10mm, 15mm].
|
/// and after the extents, e.g. [10mm, 5mm] -> [0mm, 10mm, 15mm].
|
||||||
fn points(extents: impl IntoIterator<Item = Abs>) -> impl Iterator<Item = Abs> {
|
fn points(extents: impl IntoIterator<Item = Abs>) -> impl Iterator<Item = Abs> {
|
||||||
let mut offset = Abs::zero();
|
let mut offset = Abs::zero();
|
||||||
std::iter::once(Abs::zero())
|
std::iter::once(Abs::zero())
|
||||||
|
BIN
tests/ref/bugs/table-row-missing.png
Normal file
BIN
tests/ref/bugs/table-row-missing.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.0 KiB |
8
tests/typ/bugs/table-row-missing.typ
Normal file
8
tests/typ/bugs/table-row-missing.typ
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
// Test that a table row isn't wrongly treated like a gutter row.
|
||||||
|
|
||||||
|
---
|
||||||
|
#set page(height: 70pt)
|
||||||
|
#table(
|
||||||
|
rows: 16pt,
|
||||||
|
..range(6).map(str).flatten(),
|
||||||
|
)
|
Loading…
x
Reference in New Issue
Block a user