UNPKG

@visactor/vtable

Version:

canvas table width high performance

13 lines (11 loc) 658 B
export function getColX(col, table, isRightFrozen) { if (isRightFrozen) return Math.min(table.tableNoFrameWidth, table.getAllColsWidth()) - table.getColsWidth(col, table.colCount - 1); let colX = table.getColsWidth(0, col); return col >= table.frozenColCount && (colX -= table.scrollLeft), colX; } export function getRowY(row, table, isBottomFrozen) { if (isBottomFrozen) return Math.min(table.tableNoFrameWidth, table.getAllRowsHeight()) - table.getRowsHeight(row, table.rowCount - 1); let rowY = table.getRowsHeight(0, row); return row >= table.frozenRowCount && (rowY -= table.scrollTop), rowY; } //# sourceMappingURL=util.js.map