diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-01-18 13:44:45 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-01-18 13:46:56 +0100 |
| commit | 36cae88799722fe873b578114d24201db8903d67 (patch) | |
| tree | d2986020de2fc1e9ec9bcdc1e84a736dbfda24f9 | |
| parent | cd7630415f52578b414803935437aaef0fe20eda (diff) | |
Fix table panic
| -rw-r--r-- | src/library/table.rs | 2 | ||||
| -rw-r--r-- | tests/typ/layout/table.typ | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/library/table.rs b/src/library/table.rs index c8e0e17b..0e41ad78 100644 --- a/src/library/table.rs +++ b/src/library/table.rs @@ -67,7 +67,7 @@ impl Layout for TableNode { let stroke = styles.get(Self::STROKE).map(|paint| Stroke { paint, thickness }); let padding = styles.get(Self::PADDING); - let cols = self.tracks.x.len(); + let cols = self.tracks.x.len().max(1); let children = self .children .iter() diff --git a/tests/typ/layout/table.typ b/tests/typ/layout/table.typ index 52b6f70f..0372951c 100644 --- a/tests/typ/layout/table.typ +++ b/tests/typ/layout/table.typ @@ -7,3 +7,7 @@ thickness: 2pt, [A], [B], [C], [], [], [D \ E \ F \ \ \ G], [H], ) + +--- +// Ref: false +#table() |
