UNPKG

@visactor/vtable

Version:

canvas table width high performance

19 lines (15 loc) 823 B
"use strict"; 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; } 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; } Object.defineProperty(exports, "__esModule", { value: !0 }), exports.getRowY = exports.getColX = void 0, exports.getColX = getColX, exports.getRowY = getRowY; //# sourceMappingURL=util.js.map