UNPKG

@visactor/vtable

Version:

canvas table width high performance

18 lines (15 loc) 1.41 kB
import { Text as VText } from "./../../vrender"; import { isArray } from "@visactor/vutils"; export class Text extends VText { constructor(options) { var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l; options.textBaseline || (options.textBaseline = "top"); const isPaddingNumber = 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, options.fill = null !== (_l = options.fill) && void 0 !== _l ? _l : "#000", super(options); } getSize(table) { this.AABBBounds.width(); } } //# sourceMappingURL=text.js.map