File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -87,15 +87,20 @@ class TableLayoutElement extends LayoutElement {
87
87
}
88
88
89
89
// All table rows have a height intrinsic to their (spanned) contents
90
- final rowSizes =
91
- List .generate (rows.length, (_) => IntrinsicContentTrackSize ());
90
+ final rowSizes = List .generate (rows.length, (_) => IntrinsicContentTrackSize ());
92
91
93
92
// Calculate column bounds
94
- int columnMax = rows
95
- .map ((row) => row.children
96
- .whereType <TableCellElement >()
97
- .fold (0 , (int value, child) => value + child.colspan))
98
- .fold (0 , max);
93
+ int columnMax = 0 ;
94
+ List <int > rowSpanOffsets = [];
95
+ for (final row in rows) {
96
+ final cols = row.children.whereType <TableCellElement >().fold (0 , (int value, child) => value + child.colspan) +
97
+ rowSpanOffsets.fold <int >(0 , (int offset, child) => child);
98
+ columnMax = max (cols, columnMax);
99
+ rowSpanOffsets = [
100
+ ...rowSpanOffsets.map ((value) => value - 1 ).where ((value) => value > 0 ),
101
+ ...row.children.whereType <TableCellElement >().map ((cell) => cell.rowspan - 1 ),
102
+ ];
103
+ }
99
104
100
105
// Place the cells in the rows/columns
101
106
final cells = < GridPlacement > [];
You can’t perform that action at this time.
0 commit comments