|
@@ -109,22 +109,36 @@ class PdfRTTable extends PdfElement {
|
|
|
int column = pos.column ?? 0;
|
|
|
int columnSpan = pos.columnSpan ?? 1;
|
|
|
for (int i = column; i < column + columnSpan; i++) {
|
|
|
- width += _rtTableInfo.columnDefinitions![i].width!;
|
|
|
+ width += _getWidthFromColumnDefinitions(i);
|
|
|
}
|
|
|
return width;
|
|
|
}
|
|
|
|
|
|
+ double _getWidthFromColumnDefinitions(int columnIndex) {
|
|
|
+ if (columnIndex >= _rtTableInfo.columnDefinitions!.length) {
|
|
|
+ return _rtTableInfo.columnDefinitions!.last.width!;
|
|
|
+ }
|
|
|
+ return _rtTableInfo.columnDefinitions![columnIndex].width!;
|
|
|
+ }
|
|
|
+
|
|
|
/// 获取单元格高度
|
|
|
double _getCellHeight(CellPostion pos) {
|
|
|
double height = 0;
|
|
|
int row = pos.row ?? 0;
|
|
|
int rowSpan = pos.rowSpan ?? 1;
|
|
|
for (int i = row; i < row + rowSpan; i++) {
|
|
|
- height += _rtTableInfo.rowDefinitions![i].height!;
|
|
|
+ height += _getHeightFromRowDefinitions(i);
|
|
|
}
|
|
|
return height;
|
|
|
}
|
|
|
|
|
|
+ double _getHeightFromRowDefinitions(int rowIndex) {
|
|
|
+ if (rowIndex >= _rtTableInfo.rowDefinitions!.length) {
|
|
|
+ return _rtTableInfo.rowDefinitions!.last.height!;
|
|
|
+ }
|
|
|
+ return _rtTableInfo.rowDefinitions![rowIndex].height!;
|
|
|
+ }
|
|
|
+
|
|
|
/// 合并单元格
|
|
|
BaseGrid _mergeGrids(BaseGrid baseGrid, List<BaseGrid> gridsToMerge) {
|
|
|
int row = baseGrid.row;
|