File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -99,11 +99,14 @@ class TableLayoutElement extends LayoutElement {
9999
100100 // Place the cells in the rows/columns
101101 final cells = < GridPlacement > [];
102- final columnRowOffset = List .generate (columnMax + 1 , (_) => 0 );
102+ final columnRowOffset = List .generate (columnMax, (_) => 0 );
103103 int rowi = 0 ;
104104 for (var row in rows) {
105105 int columni = 0 ;
106106 for (var child in row.children) {
107+ if (columni > columnMax - 1 ) {
108+ break ;
109+ }
107110 while (columnRowOffset[columni] > 0 ) {
108111 columnRowOffset[columni] = columnRowOffset[columni] - 1 ;
109112 columni++ ;
@@ -131,14 +134,18 @@ class TableLayoutElement extends LayoutElement {
131134 ),
132135 ),
133136 columnStart: columni,
134- columnSpan: child.colspan,
137+ columnSpan: min ( child.colspan, columnMax - columni) ,
135138 rowStart: rowi,
136- rowSpan: child.rowspan,
139+ rowSpan: min ( child.rowspan, rows.length - rowi) ,
137140 ));
138141 columnRowOffset[columni] = child.rowspan - 1 ;
139142 columni += child.colspan;
140143 }
141144 }
145+ while (columni < columnRowOffset.length) {
146+ columnRowOffset[columni] = columnRowOffset[columni] - 1 ;
147+ columni++ ;
148+ }
142149 rowi++ ;
143150 }
144151
You can’t perform that action at this time.
0 commit comments