UNPKG

@visactor/vrender-core

Version:
24 lines (19 loc) 683 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: !0 }), exports.BaseSymbol = void 0; const vutils_1 = require("@visactor/vutils"); class BaseSymbol { bounds(size, bounds) { if ((0, vutils_1.isNumber)(size)) { const halfS = size / 2; bounds.x1 = -halfS, bounds.x2 = halfS, bounds.y1 = -halfS, bounds.y2 = halfS; } else bounds.x1 = -size[0] / 2, bounds.x2 = size[0] / 2, bounds.y1 = -size[1] / 2, bounds.y2 = size[1] / 2; } parseSize(size) { return (0, vutils_1.isNumber)(size) ? size : Math.min(size[0], size[1]); } } exports.BaseSymbol = BaseSymbol; //# sourceMappingURL=base.js.map