Fix bug with extra table lines

Fixes #183
This commit is contained in:
Laurenz 2023-06-12 17:48:30 +02:00
parent 6720d8c301
commit c5cdbaeaf8
3 changed files with 14 additions and 0 deletions

View File

@ -175,6 +175,10 @@ impl Layout for TableElem {
// Add lines and backgrounds.
for (frame, rows) in layout.fragment.iter_mut().zip(&layout.rows) {
if layout.cols.is_empty() || rows.is_empty() {
continue;
}
// Render table lines.
if let Some(stroke) = &stroke {
let thickness = stroke.thickness;

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -0,0 +1,10 @@
// Ensure no empty lines before a table that doesn't fit into the first page.
---
#set page(height: 50pt)
Hello
#table(
columns: 4,
[1], [2], [3], [4]
)