File tree 1 file changed +10
-3
lines changed 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 {
99
99
100
100
// Place the cells in the rows/columns
101
101
final cells = < GridPlacement > [];
102
- final columnRowOffset = List .generate (columnMax + 1 , (_) => 0 );
102
+ final columnRowOffset = List .generate (columnMax, (_) => 0 );
103
103
int rowi = 0 ;
104
104
for (var row in rows) {
105
105
int columni = 0 ;
106
106
for (var child in row.children) {
107
+ if (columni > columnMax - 1 ) {
108
+ break ;
109
+ }
107
110
while (columnRowOffset[columni] > 0 ) {
108
111
columnRowOffset[columni] = columnRowOffset[columni] - 1 ;
109
112
columni++ ;
@@ -131,14 +134,18 @@ class TableLayoutElement extends LayoutElement {
131
134
),
132
135
),
133
136
columnStart: columni,
134
- columnSpan: child.colspan,
137
+ columnSpan: min ( child.colspan, columnMax - columni) ,
135
138
rowStart: rowi,
136
- rowSpan: child.rowspan,
139
+ rowSpan: min ( child.rowspan, rows.length - rowi) ,
137
140
));
138
141
columnRowOffset[columni] = child.rowspan - 1 ;
139
142
columni += child.colspan;
140
143
}
141
144
}
145
+ while (columni < columnRowOffset.length) {
146
+ columnRowOffset[columni] = columnRowOffset[columni] - 1 ;
147
+ columni++ ;
148
+ }
142
149
rowi++ ;
143
150
}
144
151
You can’t perform that action at this time.
0 commit comments