mirror of
https://github.com/typst/typst
synced 2025-08-05 02:37:56 +08:00
Pin colspan and rowspan for blank cells (#6401)
This commit is contained in:
parent
494e6a6422
commit
6725061841
@ -755,7 +755,14 @@ impl Show for Packed<GridCell> {
|
||||
|
||||
impl Default for Packed<GridCell> {
|
||||
fn default() -> Self {
|
||||
Packed::new(GridCell::new(Content::default()))
|
||||
Packed::new(
|
||||
// Explicitly set colspan and rowspan to ensure they won't be
|
||||
// overridden by set rules (default cells are created after
|
||||
// colspans and rowspans are processed in the resolver)
|
||||
GridCell::new(Content::default())
|
||||
.with_colspan(NonZeroUsize::ONE)
|
||||
.with_rowspan(NonZeroUsize::ONE),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -770,7 +770,14 @@ impl Show for Packed<TableCell> {
|
||||
|
||||
impl Default for Packed<TableCell> {
|
||||
fn default() -> Self {
|
||||
Packed::new(TableCell::new(Content::default()))
|
||||
Packed::new(
|
||||
// Explicitly set colspan and rowspan to ensure they won't be
|
||||
// overridden by set rules (default cells are created after
|
||||
// colspans and rowspans are processed in the resolver)
|
||||
TableCell::new(Content::default())
|
||||
.with_colspan(NonZeroUsize::ONE)
|
||||
.with_rowspan(NonZeroUsize::ONE),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
BIN
tests/ref/issue-6399-grid-cell-colspan-set-rule.png
Normal file
BIN
tests/ref/issue-6399-grid-cell-colspan-set-rule.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 232 B |
BIN
tests/ref/issue-6399-grid-cell-rowspan-set-rule.png
Normal file
BIN
tests/ref/issue-6399-grid-cell-rowspan-set-rule.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 232 B |
@ -140,3 +140,7 @@
|
||||
[e], [g], grid.cell(colspan: 2)[eee\ e\ e\ e],
|
||||
grid.cell(colspan: 4)[eeee e e e]
|
||||
)
|
||||
|
||||
--- issue-6399-grid-cell-colspan-set-rule ---
|
||||
#set grid.cell(colspan: 2)
|
||||
#grid(columns: 3, [hehe])
|
||||
|
@ -488,3 +488,7 @@
|
||||
table.cell(rowspan: 15, align: horizon, lets-repeat((rotate(-90deg, reflow: true)[*All Tests*]), 3)),
|
||||
..([123], [456], [789]) * 15
|
||||
)
|
||||
|
||||
--- issue-6399-grid-cell-rowspan-set-rule ---
|
||||
#set grid.cell(rowspan: 2)
|
||||
#grid(columns: 2, [hehe])
|
||||
|
Loading…
x
Reference in New Issue
Block a user