UNPKG

@visactor/vtable

Version:

canvas table width high performance

16 lines (13 loc) 878 B
import { isValid } from "@visactor/vutils"; import { getCellMergeRange } from "../../tools/merge-range"; export function updateCell(scenegraph, col, row) { const cellGroup = scenegraph.highPerformanceGetCell(col, row); if ("cell" === cellGroup.role && isValid(cellGroup.mergeStartCol) && isValid(cellGroup.mergeStartRow) && isValid(cellGroup.mergeEndCol) && isValid(cellGroup.mergeEndRow)) { const {colStart: colStart, colEnd: colEnd, rowStart: rowStart, rowEnd: rowEnd} = getCellMergeRange(cellGroup, scenegraph); for (let col = colStart; col <= colEnd; col++) for (let row = rowStart; row <= rowEnd; row++) { const mergeCell = scenegraph.highPerformanceGetCell(col, row); "cell" === mergeCell.role && mergeCell.addUpdateBoundTag(); } } else cellGroup.addUpdateBoundTag(); } //# sourceMappingURL=update-cell.js.map