@visactor/vtable
Version:
canvas table width high performance
52 lines (49 loc) • 1.33 kB
JavaScript
"use strict";
function getBorderLine(colWidth, rowHeight, top, right, bottom, left) {
const x = left ? -.5 : 0, y = top ? -.5 : 0, detaWidth = left && right ? 0 : left ? .5 : right ? -.5 : 0, detaHeight = top && bottom ? 0 : top ? .5 : bottom ? -.5 : 0, options = [];
return top && options.push({
x: x,
y: y,
points: [ {
x: 0,
y: 0
}, {
x: colWidth + detaWidth,
y: 0
} ]
}), right && options.push({
x: x,
y: y,
points: [ {
x: colWidth + detaWidth,
y: 0
}, {
x: colWidth + detaWidth,
y: rowHeight + detaHeight
} ]
}), bottom && options.push({
x: x,
y: y,
points: [ {
x: colWidth + detaWidth,
y: rowHeight + detaHeight
}, {
x: 0,
y: rowHeight + detaHeight
} ]
}), left && options.push({
x: x,
y: y,
points: [ {
x: 0,
y: rowHeight + detaHeight
}, {
x: 0,
y: 0
} ]
}), options;
}
Object.defineProperty(exports, "__esModule", {
value: !0
}), exports.getBorderLine = void 0, exports.getBorderLine = getBorderLine;
//# sourceMappingURL=border-line.js.map