UNPKG

@visactor/vrender-core

Version:

```typescript import { xxx } from '@visactor/vrender-core'; ```

52 lines (46 loc) 2.05 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: !0 }), exports.createShadowRoot = exports.ShadowRoot = void 0; const group_1 = require("./group"); class ShadowRoot extends group_1.Group { constructor(graphic) { super({ x: 0, y: 0 }), this.type = "shadowroot", this.shadowHost = graphic; } clearUpdateBoundTag() { super.clearUpdateBoundTag(), this.shadowHost && this.shadowHost.clearUpdateBoundTag(); } addUpdateBoundTag() { super.addUpdateBoundTag(), this.shadowHost && this.shadowHost.addUpdateBoundTag(); } addUpdateShapeAndBoundsTag() { super.addUpdateShapeAndBoundsTag(), this.shadowHost && this.shadowHost.addUpdateBoundTag(); } tryUpdateGlobalTransMatrix(clearTag = !0) { if (this.shouldUpdateGlobalMatrix()) { const m = this.transMatrix; this._globalTransMatrix ? this._globalTransMatrix.setValue(m.a, m.b, m.c, m.d, m.e, m.f) : this._globalTransMatrix = m.clone(), this.doUpdateGlobalMatrix(), clearTag && this.clearUpdateGlobalPositionTag(); } return this._globalTransMatrix; } doUpdateGlobalMatrix() { if (this.shadowHost) { const parentMatrix = this.shadowHost.globalTransMatrix; this._globalTransMatrix.multiply(parentMatrix.a, parentMatrix.b, parentMatrix.c, parentMatrix.d, parentMatrix.e, parentMatrix.f); } } tryUpdateGlobalAABBBounds() { return this._globalAABBBounds ? this._globalAABBBounds.setValue(this._AABBBounds.x1, this._AABBBounds.y1, this._AABBBounds.x2, this._AABBBounds.y2) : this._globalAABBBounds = this._AABBBounds.clone(), this.shadowHost && this._globalAABBBounds.transformWithMatrix(this.shadowHost.globalTransMatrix), this._globalAABBBounds; } } function createShadowRoot(graphic) { return new ShadowRoot(graphic); } exports.ShadowRoot = ShadowRoot, exports.createShadowRoot = createShadowRoot; //# sourceMappingURL=shadow-root.js.map