modern-canvas 0.4.45 → 0.4.47
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/dist/index.cjs +14 -4
- package/dist/index.js +3 -3
- package/dist/index.mjs +14 -4
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -242,10 +242,20 @@ function defineProperty(constructor, name, declaration = {}) {
|
|
|
242
242
|
const getDefaultValue = () => typeof defaultValue === "function" ? defaultValue() : defaultValue;
|
|
243
243
|
Object.defineProperty(constructor.prototype, name, {
|
|
244
244
|
get() {
|
|
245
|
-
|
|
245
|
+
let value = descriptor.get?.call(this);
|
|
246
|
+
if (value === void 0) {
|
|
247
|
+
value = getDefaultValue();
|
|
248
|
+
if (value !== void 0) {
|
|
249
|
+
descriptor.set?.call(this, value);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
return value;
|
|
246
253
|
},
|
|
247
254
|
set(value) {
|
|
248
|
-
|
|
255
|
+
let oldValue = descriptor.get?.call(this);
|
|
256
|
+
if (oldValue === void 0) {
|
|
257
|
+
oldValue = getDefaultValue();
|
|
258
|
+
}
|
|
249
259
|
descriptor.set?.call(this, value);
|
|
250
260
|
this.requestUpdate?.(name, oldValue, declaration);
|
|
251
261
|
},
|
|
@@ -6052,7 +6062,7 @@ let Node = class extends CoreObject {
|
|
|
6052
6062
|
removeChild(child) {
|
|
6053
6063
|
const index = child.getIndex();
|
|
6054
6064
|
if (this.is(child.parent) && index > -1) {
|
|
6055
|
-
this._children.
|
|
6065
|
+
this._children.getInternal(child.internalMode).splice(index, 1);
|
|
6056
6066
|
child.setParent(void 0);
|
|
6057
6067
|
this.emit("removeChild", child, index);
|
|
6058
6068
|
}
|
|
@@ -9508,7 +9518,7 @@ let Node2D = class extends CanvasItem {
|
|
|
9508
9518
|
_process(delta) {
|
|
9509
9519
|
super._process(delta);
|
|
9510
9520
|
const parent = this.getParent();
|
|
9511
|
-
if (this._parentTransformDirtyId !== parent?.globalTransform?.dirtyId) {
|
|
9521
|
+
if (parent?.globalTransform && this._parentTransformDirtyId !== parent?.globalTransform?.dirtyId) {
|
|
9512
9522
|
this.requestRelayout();
|
|
9513
9523
|
}
|
|
9514
9524
|
}
|