UNPKG

@visactor/vtable

Version:

canvas table width high performance

20 lines (15 loc) 1.46 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: !0 }), exports.Image = void 0; const vrender_1 = require("./../../vrender"), vutils_1 = require("@visactor/vutils"); class Image extends vrender_1.Image { constructor(options) { var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k; options.src && (options.image = options.src), "circle" === options.shape && (options.cornerRadius = options.width / 2); const isPaddingNumber = (0, vutils_1.isArray)(options.boundsPadding), padding = [ null !== (_b = null !== (_a = options.marginTop) && void 0 !== _a ? _a : isPaddingNumber ? options.boundsPadding[0] : options.boundsPadding) && void 0 !== _b ? _b : 0, null !== (_d = null !== (_c = options.marginRight) && void 0 !== _c ? _c : isPaddingNumber ? options.boundsPadding[1] : options.boundsPadding) && void 0 !== _d ? _d : 0, null !== (_g = null !== (_e = options.marginBottom) && void 0 !== _e ? _e : isPaddingNumber ? null !== (_f = options.boundsPadding[2]) && void 0 !== _f ? _f : options.boundsPadding[0] : options.boundsPadding) && void 0 !== _g ? _g : 0, null !== (_k = null !== (_h = options.marginLeft) && void 0 !== _h ? _h : isPaddingNumber ? null !== (_j = options.boundsPadding[3]) && void 0 !== _j ? _j : options.boundsPadding[1] : options.boundsPadding) && void 0 !== _k ? _k : 0 ]; options.boundsPadding = padding, super(options); } } exports.Image = Image; //# sourceMappingURL=image.js.map