@sepveneto/dao 0.1.6 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/dist/dao.cjs +1 -1
- package/dist/dao.cjs.map +1 -1
- package/dist/dao.js +93 -30
- package/dist/dao.js.map +1 -1
- package/dist/maths/Bounds.d.ts +1 -0
- package/dist/maths/Matrix.d.ts +6 -3
- package/dist/maths/Point.d.ts +2 -2
- package/dist/maths/index.d.ts +4 -0
- package/dist/scene/ViewContainer.d.ts +1 -0
- package/dist/scene/container/Container.d.ts +13 -9
- package/dist/scene/container/RenderGroup.d.ts +6 -0
- package/dist/scene/container/__tests__/Container.test.d.ts +1 -0
- package/dist/scene/container/__tests__/DummyEffect.d.ts +12 -0
- package/dist/scene/container/__tests__/DummyView.d.ts +26 -0
- package/dist/scene/container/__tests__/RenderGroupSystem.test.d.ts +1 -0
- package/dist/scene/container/__tests__/getLocalBounds..test.d.ts +1 -0
- package/dist/scene/container/__tests__/toGlobal.test.d.ts +1 -0
- package/dist/scene/container/__tests__/toLocal.test.d.ts +1 -0
- package/dist/scene/container/mixins/measureMixin.d.ts +5 -1
- package/dist/scene/container/mixins/onRenderMixin.d.ts +9 -0
- package/dist/scene/graphics/Graphics.d.ts +3 -1
- package/dist/scene/graphics/GraphicsContext.d.ts +1 -0
- package/package.json +1 -1
package/dist/dao.js
CHANGED
|
@@ -20,6 +20,16 @@ var Matrix = class n {
|
|
|
20
20
|
let { x: j, y: M } = n;
|
|
21
21
|
return new Vector2(j * this.a + M * this.c + this.tx, j * this.b + M * this.d + this.ty);
|
|
22
22
|
}
|
|
23
|
+
translate(n, j) {
|
|
24
|
+
return this.tx += n, this.ty += j, this;
|
|
25
|
+
}
|
|
26
|
+
rotate(n) {
|
|
27
|
+
let j = Math.cos(n), M = Math.sin(n), N = this.a, P = this.c, F = this.tx;
|
|
28
|
+
return this.a = N * j - this.b * M, this.b = N * M + this.b * j, this.c = P * j - this.d * M, this.d = P * M + this.d * j, this.tx = F * j - this.ty * M, this.ty = F * M + this.ty * j, this;
|
|
29
|
+
}
|
|
30
|
+
scale(n, j) {
|
|
31
|
+
return this.a *= n, this.d *= j, this.c *= n, this.b *= j, this.tx *= n, this.ty *= j, this;
|
|
32
|
+
}
|
|
23
33
|
appendFrom(n, j) {
|
|
24
34
|
let M = n.a, N = n.b, P = n.c, F = n.d, I = n.tx, L = n.ty, R = j.a, z = j.b, B = j.c, V = j.d, H = j.tx, U = j.ty;
|
|
25
35
|
this.a = M * R + N * B, this.b = M * z + N * V, this.c = P * R + F * B, this.d = P * z + F * V, this.tx = I * R + L * B + H, this.ty = I * z + L * V + U;
|
|
@@ -216,7 +226,7 @@ var FederatedEvent = class {
|
|
|
216
226
|
return N && N[0];
|
|
217
227
|
}
|
|
218
228
|
_interactivePrune(n) {
|
|
219
|
-
return !n || !n.visible || n.eventMode === "none";
|
|
229
|
+
return !n || !n.visible || !n.renderable || !n.measurable || n.eventMode === "none";
|
|
220
230
|
}
|
|
221
231
|
hitTestMoveRecursive(n, j, M) {
|
|
222
232
|
let N = !1;
|
|
@@ -237,6 +247,7 @@ var FederatedEvent = class {
|
|
|
237
247
|
}
|
|
238
248
|
}
|
|
239
249
|
hitTestRecursive(n, j, M) {
|
|
250
|
+
if (this._interactivePrune(n)) return;
|
|
240
251
|
let N = n.children;
|
|
241
252
|
for (let P = N.length - 1; P >= 0; P--) {
|
|
242
253
|
let F = N[P], I = this.hitTestRecursive(F, this._isInteractive(j) ? j : F.eventMode, M);
|
|
@@ -286,7 +297,7 @@ var InstructionSet = class {
|
|
|
286
297
|
this.worldTransform = new Matrix(), this.localTransform = new Matrix(), this.root = null, this.instructionSet = new InstructionSet(), this.structureDidChange = !0, this.renderGroupParent = null, this.renderGroupChildren = [], this.childrenToUpdate = Object.create(null), this.childrenRenderablesToUpdate = {
|
|
287
298
|
list: [],
|
|
288
299
|
index: 0
|
|
289
|
-
}, this.init(n);
|
|
300
|
+
}, this._onRenderContainers = [], this.init(n);
|
|
290
301
|
}
|
|
291
302
|
init(n) {
|
|
292
303
|
this.root = n;
|
|
@@ -294,7 +305,11 @@ var InstructionSet = class {
|
|
|
294
305
|
for (let n = 0; n < j.length; ++n) this.addChild(j[n]);
|
|
295
306
|
}
|
|
296
307
|
addChild(n) {
|
|
297
|
-
this.structureDidChange = !0, n.parentRenderGroup = this, n.parent === this.root ? n.relativeRenderGroupDepth = 1 : n.relativeRenderGroupDepth = n.parent.relativeRenderGroupDepth + 1, n.didChange = !0, this.onChildUpdate(n)
|
|
308
|
+
if (this.structureDidChange = !0, n.parentRenderGroup = this, n.parent === this.root ? n.relativeRenderGroupDepth = 1 : n.relativeRenderGroupDepth = n.parent.relativeRenderGroupDepth + 1, n.didChange = !0, this.onChildUpdate(n), n.renderGroup) {
|
|
309
|
+
this.addRenderGroupChild(n.renderGroup);
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
312
|
+
n._onRender && this.addOnRender(n);
|
|
298
313
|
let j = n.children;
|
|
299
314
|
for (let n = 0; n < j.length; ++n) this.addChild(j[n]);
|
|
300
315
|
}
|
|
@@ -309,10 +324,22 @@ var InstructionSet = class {
|
|
|
309
324
|
removeChildren(n) {
|
|
310
325
|
for (let j = 0; j < n.length; ++j) this.removeChild(n[j]);
|
|
311
326
|
}
|
|
327
|
+
addRenderGroupChild(n) {
|
|
328
|
+
n.renderGroupParent && n.renderGroupParent._removeRenderGroupChild(n), n.renderGroupParent = this, this.renderGroupChildren.push(n);
|
|
329
|
+
}
|
|
312
330
|
_removeRenderGroupChild(n) {
|
|
313
331
|
let j = this.renderGroupChildren.indexOf(n);
|
|
314
332
|
j > -1 && this.renderGroupChildren.splice(j, 1), n.renderGroupParent = null;
|
|
315
333
|
}
|
|
334
|
+
addOnRender(n) {
|
|
335
|
+
this._onRenderContainers.push(n);
|
|
336
|
+
}
|
|
337
|
+
removeOnRender(n) {
|
|
338
|
+
this._onRenderContainers.splice(this._onRenderContainers.indexOf(n), 1);
|
|
339
|
+
}
|
|
340
|
+
runOnRender(n) {
|
|
341
|
+
for (let j = 0; j < this._onRenderContainers.length; ++j) this._onRenderContainers[j]._onRender(n);
|
|
342
|
+
}
|
|
316
343
|
onChildViewUpdate(n) {
|
|
317
344
|
this.childrenRenderablesToUpdate.list[this.childrenRenderablesToUpdate.index++] = n;
|
|
318
345
|
}
|
|
@@ -327,7 +354,7 @@ var InstructionSet = class {
|
|
|
327
354
|
n.globalDisplayStatus < 7 || (this.instructionSet.renderPipes[n.renderPipeId].updateRenderable(n), n.didViewUpdate = !1);
|
|
328
355
|
}
|
|
329
356
|
destroy() {
|
|
330
|
-
this.root = null, this.childrenRenderablesToUpdate = null, this.childrenToUpdate = null, this.renderGroupChildren = null, this.instructionSet = null;
|
|
357
|
+
this.root = null, this.childrenRenderablesToUpdate = null, this.childrenToUpdate = null, this._onRenderContainers = null, this.renderGroupChildren = null, this.instructionSet = null;
|
|
331
358
|
}
|
|
332
359
|
}, uidCache = { default: -1 };
|
|
333
360
|
function uid(n = "default") {
|
|
@@ -467,6 +494,9 @@ var eventemitter3_default = (/* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJS
|
|
|
467
494
|
clear() {
|
|
468
495
|
this.minX = Infinity, this.minY = Infinity, this.maxX = -Infinity, this.maxY = -Infinity;
|
|
469
496
|
}
|
|
497
|
+
pad(n, j = n) {
|
|
498
|
+
return this.minX -= n, this.maxX += n, this.minY -= j, this.maxY += j, this;
|
|
499
|
+
}
|
|
470
500
|
get width() {
|
|
471
501
|
return this.maxX - this.minX;
|
|
472
502
|
}
|
|
@@ -511,7 +541,7 @@ var eventemitter3_default = (/* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJS
|
|
|
511
541
|
get rectangle() {
|
|
512
542
|
this._rectangle || (this._rectangle = new Rectangle());
|
|
513
543
|
let n = this._rectangle;
|
|
514
|
-
return n.x = this.minX, n.y = this.minY, n.width = this.maxX - this.minX, n.height = this.maxY - this.minY, n;
|
|
544
|
+
return this.minX > this.maxX || this.minY > this.maxY ? (n.x = 0, n.y = 0, n.width = 0, n.height = 0) : (n.x = this.minX, n.y = this.minY, n.width = this.maxX - this.minX, n.height = this.maxY - this.minY), n;
|
|
515
545
|
}
|
|
516
546
|
addBoundsMask(n) {
|
|
517
547
|
this.minX = this.minX > n.minX ? this.minX : n.minX, this.minY = this.minY > n.minY ? this.minY : n.minY, this.maxX = this.maxX < n.maxX ? this.maxX : n.maxX, this.maxY = this.maxY < n.maxY ? this.maxY : n.maxY;
|
|
@@ -584,7 +614,6 @@ const effectMixin = {
|
|
|
584
614
|
sortDirty: !1
|
|
585
615
|
}, measureMixin = {
|
|
586
616
|
_localBoundsCacheData: null,
|
|
587
|
-
_localBounds: null,
|
|
588
617
|
_setWidth(n, j) {
|
|
589
618
|
let M = Math.sign(this.scale.x) || 1;
|
|
590
619
|
j === 0 ? this.scale.x = M : this.scale.x = n / j * M;
|
|
@@ -594,9 +623,25 @@ const effectMixin = {
|
|
|
594
623
|
j === 0 ? this.scale.y = M : this.scale.y = n / j * M;
|
|
595
624
|
},
|
|
596
625
|
getLocalBounds() {
|
|
597
|
-
|
|
626
|
+
this._localBoundsCacheData || (this._localBoundsCacheData = {
|
|
627
|
+
data: [],
|
|
628
|
+
index: 1,
|
|
629
|
+
didChange: !1,
|
|
630
|
+
localBounds: new Bounds()
|
|
631
|
+
});
|
|
632
|
+
let n = this._localBoundsCacheData;
|
|
633
|
+
return n.index = 1, n.didChange = !1, n.data[0] !== this._didViewChangeTick && (n.didChange = !0, n.data[0] = this._didViewChangeTick), checkChildrenDidChange(this, n), n.didChange && getLocalBounds(this, n.localBounds), n.localBounds;
|
|
634
|
+
}
|
|
635
|
+
};
|
|
636
|
+
function checkChildrenDidChange(n, j) {
|
|
637
|
+
let M = n.children;
|
|
638
|
+
for (let n = 0; n < M.length; ++n) {
|
|
639
|
+
let N = M[n], P = N.uid, F = (N._didViewChangeTick & 65535) << 16 | N._didContainerChangeTick & 65535, I = j.index;
|
|
640
|
+
(j.data[I] !== P || j.data[I + 1] !== F) && (j.data[I] = P, j.data[I + 1] = F, j.didChange = !0), j.index += 2, N.children.length && checkChildrenDidChange(N, j);
|
|
598
641
|
}
|
|
599
|
-
|
|
642
|
+
return j.didChange;
|
|
643
|
+
}
|
|
644
|
+
const childrenHelperMixin = { removeChildren(n = 0, j) {
|
|
600
645
|
let M = j == null ? this.children.length : j, N = M - n, P = [];
|
|
601
646
|
if (N > 0 && N <= M) {
|
|
602
647
|
for (let j = M - 1; j >= n; --j) {
|
|
@@ -605,7 +650,7 @@ const effectMixin = {
|
|
|
605
650
|
}
|
|
606
651
|
removeItems(this.children, n, M);
|
|
607
652
|
let j = this.renderGroup || this.parentRenderGroup;
|
|
608
|
-
return j && j.removeChildren(P), P;
|
|
653
|
+
return j && j.removeChildren(P), P.length > 0 && this._didViewChangeTick++, P;
|
|
609
654
|
} else if (N === 0 && this.children.length === 0) return P;
|
|
610
655
|
throw Error("removeChildren: numeric values are outside the acceptable range.");
|
|
611
656
|
} };
|
|
@@ -620,11 +665,12 @@ function removeItems(n, j, M) {
|
|
|
620
665
|
const UPDATE_COLOR = 1, UPDATE_BLEND = 2, UPDATE_VISIBLE = 4, UPDATE_TRANSFORM = 8;
|
|
621
666
|
var defaultSkew = new ObservablePoint(null), defaultOrigin = new ObservablePoint(null), defaultScale = new ObservablePoint(null, 1, 1), defaultPivot = new ObservablePoint(null), Container = class extends eventemitter3_default {
|
|
622
667
|
constructor(n = {}) {
|
|
623
|
-
|
|
668
|
+
var j, M;
|
|
669
|
+
super(), this.uid = uid("renderable"), this.destroyed = !1, this.renderGroup = null, this.parentRenderGroup = null, this.parent = null, this.eventMode = "passive", this.hitArea = null, this._position = new ObservablePoint(this, 0, 0), this.includeInBuild = !0, this.didChange = !1, this.didViewUpdate = !1, this.isSimple = !0, this.measurable = !0, this.relativeRenderGroupDepth = 0, this._didViewChangeTick = 0, this._didContainerChangeTick = 0, this._localTransformUpdateTick = 0, this._updateFlags = 15, this.localDisplayStatus = 7, this.globalDisplayStatus = 7, this.children = [], this.localTransform = new Matrix(), this.relativeGroupTransform = new Matrix(), this.groupTransform = this.relativeGroupTransform, this._rotation = 0, this._cx = 1, this._sx = 0, this._cy = 0, this._sy = 1, this._skew = defaultSkew, this._scale = defaultScale, this._origin = defaultOrigin, this._pivot = defaultPivot, this.localAlpha = 1, this.groupColor = 16777215, this.localColor = 16777215, this.groupAlpha = 1, this.groupColorAlpha = 4294967295, assignWithIgnore(this, n, {
|
|
624
670
|
children: !0,
|
|
625
671
|
parent: !0,
|
|
626
672
|
effects: !0
|
|
627
|
-
}), this.effects = [];
|
|
673
|
+
}), (j = n.children) == null || j.forEach((n) => this.addChild(n)), (M = n.parent) == null || M.addChild(this), this.effects = [];
|
|
628
674
|
}
|
|
629
675
|
get renderable() {
|
|
630
676
|
return !!(this.localDisplayStatus & 1);
|
|
@@ -638,7 +684,7 @@ var defaultSkew = new ObservablePoint(null), defaultOrigin = new ObservablePoint
|
|
|
638
684
|
}
|
|
639
685
|
set visible(n) {
|
|
640
686
|
let j = n ? 2 : 0;
|
|
641
|
-
(this.localDisplayStatus & 2) !== j && (this.parentRenderGroup && (this.parentRenderGroup.structureDidChange = !0), this._updateFlags |= 4, this.localDisplayStatus ^= 2, this._onUpdate());
|
|
687
|
+
(this.localDisplayStatus & 2) !== j && (this.parentRenderGroup && (this.parentRenderGroup.structureDidChange = !0), this._updateFlags |= 4, this.localDisplayStatus ^= 2, this._onUpdate(), this.emit("visibleChanged", n));
|
|
642
688
|
}
|
|
643
689
|
get isRenderGroup() {
|
|
644
690
|
return !!this.renderGroup;
|
|
@@ -659,10 +705,12 @@ var defaultSkew = new ObservablePoint(null), defaultOrigin = new ObservablePoint
|
|
|
659
705
|
this.sortDirty && (this.sortDirty = !1, this.children.sort(sortChildren));
|
|
660
706
|
}
|
|
661
707
|
depthOfChildModified() {
|
|
662
|
-
this.parent && (this.parent.sortableChildren = !0, this.parent.sortDirty = !0), this.parentRenderGroup;
|
|
708
|
+
this.parent && (this.parent.sortableChildren = !0, this.parent.sortDirty = !0), this.parentRenderGroup && (this.parentRenderGroup.structureDidChange = !0);
|
|
663
709
|
}
|
|
664
710
|
enableRenderGroup() {
|
|
665
|
-
|
|
711
|
+
if (this.renderGroup) return;
|
|
712
|
+
let n = this.parentRenderGroup;
|
|
713
|
+
n == null || n.removeChild(this), this.renderGroup = new RenderGroup(this), this.groupTransform = new Matrix(), n == null || n.addChild(this), this._updateIsSimple();
|
|
666
714
|
}
|
|
667
715
|
disableRenderGroup() {
|
|
668
716
|
if (!this.renderGroup) return;
|
|
@@ -695,7 +743,7 @@ var defaultSkew = new ObservablePoint(null), defaultOrigin = new ObservablePoint
|
|
|
695
743
|
this._cx = Math.cos(n + j.y), this._sx = Math.sin(n + j.y), this._cy = -Math.sin(n - j.x), this._sy = Math.cos(n - j.x);
|
|
696
744
|
}
|
|
697
745
|
updateLocalTransform() {
|
|
698
|
-
let n = this.
|
|
746
|
+
let n = this._didContainerChangeTick;
|
|
699
747
|
if (this._localTransformUpdateTick === n) return;
|
|
700
748
|
this._localTransformUpdateTick = n, this._updateSkew();
|
|
701
749
|
let j = this.position, M = this.localTransform, N = this._scale.x, P = this._scale.y, F = -this._origin.x, I = -this._origin.y, L = this._pivot.x, R = this._pivot.y;
|
|
@@ -767,7 +815,7 @@ var defaultSkew = new ObservablePoint(null), defaultOrigin = new ObservablePoint
|
|
|
767
815
|
return this._origin === defaultOrigin && (this._origin = new ObservablePoint(this, 0, 0)), this._origin;
|
|
768
816
|
}
|
|
769
817
|
set origin(n) {
|
|
770
|
-
this._origin === defaultOrigin && (this._origin = new ObservablePoint(this, 0, 0)), this._origin.copyFrom(n);
|
|
818
|
+
this._origin === defaultOrigin && (this._origin = new ObservablePoint(this, 0, 0)), typeof n == "number" ? this._origin.set(n) : this._origin.copyFrom(n);
|
|
771
819
|
}
|
|
772
820
|
get width() {
|
|
773
821
|
return Math.abs(this.scale.x * this.getLocalBounds().width);
|
|
@@ -783,7 +831,7 @@ var defaultSkew = new ObservablePoint(null), defaultOrigin = new ObservablePoint
|
|
|
783
831
|
return n[0];
|
|
784
832
|
}
|
|
785
833
|
let j = n[0], M = this.renderGroup || this.parentRenderGroup;
|
|
786
|
-
return j.parent === this ? (this.children.splice(this.children.indexOf(j), 1), this.children.push(j), M && (M.structureDidChange = !0), j) : (this.sortableChildren && (this.sortDirty = !0), j.parent && j.parent.removeChild(j), this.children.push(j), this.sortableChildren && (this.sortDirty = !0), j.parent = this, j.didChange = !0, j._updateFlags = 7, M && M.addChild(j), j._zIndex != 0 && j.depthOfChildModified(), j);
|
|
834
|
+
return j.parent === this ? (this.children.splice(this.children.indexOf(j), 1), this.children.push(j), M && (M.structureDidChange = !0), j) : (this.sortableChildren && (this.sortDirty = !0), j.parent && j.parent.removeChild(j), this.children.push(j), this.sortableChildren && (this.sortDirty = !0), j.parent = this, j.didChange = !0, j._updateFlags = 7, M && M.addChild(j), this._didViewChangeTick++, j._zIndex != 0 && j.depthOfChildModified(), j);
|
|
787
835
|
}
|
|
788
836
|
removeChild(...n) {
|
|
789
837
|
if (n.length > 1) {
|
|
@@ -793,10 +841,10 @@ var defaultSkew = new ObservablePoint(null), defaultOrigin = new ObservablePoint
|
|
|
793
841
|
let j = n[0];
|
|
794
842
|
if (!j) return j;
|
|
795
843
|
let M = this.children.indexOf(j);
|
|
796
|
-
return M > -1 && (this.children.splice(M, 1), j.parent = null), j;
|
|
844
|
+
return M > -1 && (this._didViewChangeTick++, this.children.splice(M, 1), this.renderGroup ? this.renderGroup.removeChild(j) : this.parentRenderGroup && this.parentRenderGroup.removeChild(j), j.parent = null), j;
|
|
797
845
|
}
|
|
798
846
|
_onUpdate(n) {
|
|
799
|
-
n && n === this._skew && this._updateSkew(), this.
|
|
847
|
+
n && n === this._skew && this._updateSkew(), this._didContainerChangeTick++, !this.didChange && (this.didChange = !0, this.parentRenderGroup && this.parentRenderGroup.onChildUpdate(this));
|
|
800
848
|
}
|
|
801
849
|
toGlobal(n, j) {
|
|
802
850
|
return this.getGlobalTransform(j).apply(n);
|
|
@@ -880,7 +928,7 @@ var _RenderGroupSystem, RenderGroupSystem = class {
|
|
|
880
928
|
}
|
|
881
929
|
_updateRenderGroup(n) {
|
|
882
930
|
let j = this.renderer, M = j.renderPipes;
|
|
883
|
-
n.instructionSet.renderPipes = M, n.structureDidChange ? clearList(n.childrenRenderablesToUpdate.list, 0) : validateRenderables(n, M), updateRenderGroupTransform(n), n.structureDidChange && (n.structureDidChange = !1, this._buildInstructions(n, j)), n.childrenRenderablesToUpdate.index = 0;
|
|
931
|
+
n.runOnRender(j), n.instructionSet.renderPipes = M, n.structureDidChange ? clearList(n.childrenRenderablesToUpdate.list, 0) : validateRenderables(n, M), updateRenderGroupTransform(n), n.structureDidChange && (n.structureDidChange = !1, this._buildInstructions(n, j)), n.childrenRenderablesToUpdate.index = 0;
|
|
884
932
|
}
|
|
885
933
|
render({ container: n, transform: j }) {
|
|
886
934
|
let M = this.renderer;
|
|
@@ -961,13 +1009,13 @@ var _TextPipe, TextPipe = class {
|
|
|
961
1009
|
_TextPipe = TextPipe, _TextPipe.desc = { name: "text" };
|
|
962
1010
|
var ViewContainer = class extends Container {
|
|
963
1011
|
constructor(...n) {
|
|
964
|
-
super(...n), this._runtimeData = Object.create(null), this._roundPixels = 0, this._bounds = new Bounds(0, 1, 0, 0);
|
|
1012
|
+
super(...n), this._runtimeData = Object.create(null), this._roundPixels = 0, this._bounds = new Bounds(0, 1, 0, 0), this._boundsDirty = !0;
|
|
965
1013
|
}
|
|
966
1014
|
get bounds() {
|
|
967
|
-
return this.updateBounds(), this._bounds;
|
|
1015
|
+
return this._boundsDirty ? (this.updateBounds(), this._boundsDirty = !1, this._bounds) : this._bounds;
|
|
968
1016
|
}
|
|
969
1017
|
onViewUpdate() {
|
|
970
|
-
if (this.didViewUpdate) return;
|
|
1018
|
+
if (this._didViewChangeTick++, this._boundsDirty = !0, this.didViewUpdate) return;
|
|
971
1019
|
this.didViewUpdate = !0;
|
|
972
1020
|
let n = this.renderGroup || this.parentRenderGroup;
|
|
973
1021
|
n && n.onChildViewUpdate(this);
|
|
@@ -1209,7 +1257,7 @@ var ShapePath = class {
|
|
|
1209
1257
|
}
|
|
1210
1258
|
}, _GraphicsContext, GraphicsContext = class n {
|
|
1211
1259
|
constructor() {
|
|
1212
|
-
this._activePath = new GraphicsPath(), this._bounds = new Bounds(), this.instructions = [];
|
|
1260
|
+
this._activePath = new GraphicsPath(), this._bounds = new Bounds(), this._boundsDirty = !0, this.instructions = [];
|
|
1213
1261
|
}
|
|
1214
1262
|
setStrokeStyle(j) {
|
|
1215
1263
|
this._strokeStyle = toStrokeStyle(j, n.defaultStrokeStyle);
|
|
@@ -1217,7 +1265,9 @@ var ShapePath = class {
|
|
|
1217
1265
|
clear() {
|
|
1218
1266
|
return this._activePath.clear(), this.instructions.length = 0, this.onUpdate(), this;
|
|
1219
1267
|
}
|
|
1220
|
-
onUpdate() {
|
|
1268
|
+
onUpdate() {
|
|
1269
|
+
this._boundsDirty = !0;
|
|
1270
|
+
}
|
|
1221
1271
|
moveTo(n, j) {
|
|
1222
1272
|
return this._activePath.moveTo(n, j), this;
|
|
1223
1273
|
}
|
|
@@ -1263,6 +1313,8 @@ var ShapePath = class {
|
|
|
1263
1313
|
this._activePath.clear(), this._activePath.moveTo(n, j);
|
|
1264
1314
|
}
|
|
1265
1315
|
get bounds() {
|
|
1316
|
+
if (!this._boundsDirty) return this._bounds;
|
|
1317
|
+
this._boundsDirty = !1;
|
|
1266
1318
|
let n = this._bounds;
|
|
1267
1319
|
n.clear();
|
|
1268
1320
|
for (let j = 0; j < this.instructions.length; ++j) {
|
|
@@ -1277,7 +1329,7 @@ var ShapePath = class {
|
|
|
1277
1329
|
n.addFrame(F.minX - P, F.minY - P, F.maxX + P, F.maxY + P);
|
|
1278
1330
|
}
|
|
1279
1331
|
}
|
|
1280
|
-
return n;
|
|
1332
|
+
return n.isValid || n.set(0, 0, 0, 0), n;
|
|
1281
1333
|
}
|
|
1282
1334
|
clone() {
|
|
1283
1335
|
let j = new n();
|
|
@@ -1307,7 +1359,13 @@ var Graphics = class extends ViewContainer {
|
|
|
1307
1359
|
super({
|
|
1308
1360
|
label: "Graphics",
|
|
1309
1361
|
...M
|
|
1310
|
-
}), this.renderPipeId = "graphics", j ? this.context = j : this.context = new GraphicsContext();
|
|
1362
|
+
}), this.renderPipeId = "graphics", j ? this.context = j : this.context = new GraphicsContext(), this.didViewUpdate = !0;
|
|
1363
|
+
}
|
|
1364
|
+
get context() {
|
|
1365
|
+
return this._context;
|
|
1366
|
+
}
|
|
1367
|
+
set context(n) {
|
|
1368
|
+
n !== this._context && (this._context = n, this.onViewUpdate());
|
|
1311
1369
|
}
|
|
1312
1370
|
setStrokeStyle(...n) {
|
|
1313
1371
|
return this._callContextMethod("setStrokeStyle", n);
|
|
@@ -1341,7 +1399,7 @@ var Graphics = class extends ViewContainer {
|
|
|
1341
1399
|
}
|
|
1342
1400
|
updateBounds() {}
|
|
1343
1401
|
get bounds() {
|
|
1344
|
-
return this.
|
|
1402
|
+
return this._context.bounds;
|
|
1345
1403
|
}
|
|
1346
1404
|
clear() {
|
|
1347
1405
|
return this._callContextMethod("clear", []);
|
|
@@ -1929,7 +1987,9 @@ var RenderTexture = class n extends Texture {
|
|
|
1929
1987
|
constructor(n) {
|
|
1930
1988
|
var j;
|
|
1931
1989
|
let { text: M, resolution: N, style: P, width: F, height: I, ...L } = n;
|
|
1932
|
-
super(L), this.renderPipeId = "text", this._didTextUpdate = !0, this._resolution = null, this._autoResolution = !0, this._anchor = new ObservablePoint(
|
|
1990
|
+
super(L), this.renderPipeId = "text", this._didTextUpdate = !0, this._resolution = null, this._autoResolution = !0, this._anchor = new ObservablePoint({ _onUpdate: () => {
|
|
1991
|
+
this.onViewUpdate();
|
|
1992
|
+
} }, 0, 0), this.text = (j = n.text) == null ? "" : j, this.style = P, this.resolution = N == null ? null : N, F != null && (this.width = F), I != null && (this.height = I);
|
|
1933
1993
|
}
|
|
1934
1994
|
set resolution(n) {
|
|
1935
1995
|
this._autoResolution = n === null, this._resolution = n, this.onViewUpdate();
|
|
@@ -2438,7 +2498,7 @@ var AssetsClass = class {
|
|
|
2438
2498
|
this._initialized || this.init();
|
|
2439
2499
|
let M = n.map((n) => ({
|
|
2440
2500
|
...n,
|
|
2441
|
-
src:
|
|
2501
|
+
src: toAbsolutePath(n.src, this.basePath)
|
|
2442
2502
|
}));
|
|
2443
2503
|
return await this._mapLoadToResolve(M, j);
|
|
2444
2504
|
}
|
|
@@ -2456,6 +2516,9 @@ var AssetsClass = class {
|
|
|
2456
2516
|
}
|
|
2457
2517
|
};
|
|
2458
2518
|
const Assets = new AssetsClass();
|
|
2519
|
+
function toAbsolutePath(n, j) {
|
|
2520
|
+
return n.startsWith("http") || !j ? n : n.startsWith("/") && j.endsWith("/") ? j + n.slice(1) : n.startsWith("/") && !j.endsWith("/") || !n.startsWith("/") && j.endsWith("/") ? j + n : `${j}/${n}`;
|
|
2521
|
+
}
|
|
2459
2522
|
export { Application, Assets, AssetsClass, CanvasRenderer, Container, Graphics, GraphicsContext, GraphicsPipe, Matrix, PI_2, Rectangle, RenderGroup, RenderTexture, Sprite, Text, TextPipe, Texture, Ticker, TickerListener, UPDATE_BLEND, UPDATE_COLOR, UPDATE_TRANSFORM, UPDATE_VISIBLE, Vector2, ViewContainer, buildShapePath, nextPow2 };
|
|
2460
2523
|
|
|
2461
2524
|
//# sourceMappingURL=dao.js.map
|