ZMJGanttChart 表格sdk问题
2021-08-04 本文已影响0人
adaodao3056
ZMJGanttChart 当column 的宽度不一样时 merge后的宽度计算不准 问题处理
修改源码 "ZMJLayoutEngine.h" 文件
image.png ZMJCellRange *mergedCell = [self.spreadsheetView mergedCellFor:[Location locationWithRow:row column:column]];
if (mergedCell) {
CGFloat cellWidth = 0;
CGFloat cellHeight = 0;
if (!CGSizeEqualToSize(CGSizeZero, mergedCell.size)) {
cellWidth = mergedCell.size.width;
cellHeight = mergedCell.size.height;
} else {
for (NSInteger col = mergedCell.from.column; col <= mergedCell.to.column; ++col) {
cellWidth += self.columnWidthCache[col].floatValue + self.intercellSpacing.width;
}
for (NSInteger r = mergedCell.from.row; r <= mergedCell.to.row; ++r) {
cellHeight += self.rowHeightCache[r].floatValue + self.intercellSpacing.height;
}
mergedCell.size = CGSizeMake(cellWidth, cellHeight);
}