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 @@ -88,15 +88,20 @@ class TableLayoutElement extends LayoutElement {
8888 }
8989
9090 // All table rows have a height intrinsic to their (spanned) contents
91- final rowSizes =
92- List .generate (rows.length, (_) => IntrinsicContentTrackSize ());
91+ final rowSizes = List .generate (rows.length, (_) => IntrinsicContentTrackSize ());
9392
9493 // Calculate column bounds
95- int columnMax = rows
96- .map ((row) => row.children
97- .whereType <TableCellElement >()
98- .fold (0 , (int value, child) => value + child.colspan))
99- .fold (0 , max);
94+ int columnMax = 0 ;
95+ List <int > rowSpanOffsets = [];
96+ for (final row in rows) {
97+ final cols = row.children.whereType <TableCellElement >().fold (0 , (int value, child) => value + child.colspan) +
98+ rowSpanOffsets.fold <int >(0 , (int offset, child) => child);
99+ columnMax = max (cols, columnMax);
100+ rowSpanOffsets = [
101+ ...rowSpanOffsets.map ((value) => value - 1 ).where ((value) => value > 0 ),
102+ ...row.children.whereType <TableCellElement >().map ((cell) => cell.rowspan - 1 ),
103+ ];
104+ }
100105
101106 // Place the cells in the rows/columns
102107 final cells = < GridPlacement > [];
You can’t perform that action at this time.
0 commit comments