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 CHANGED
@@ -248,10 +248,20 @@ function defineProperty(constructor, name, declaration = {}) {
248
248
  const getDefaultValue = () => typeof defaultValue === "function" ? defaultValue() : defaultValue;
249
249
  Object.defineProperty(constructor.prototype, name, {
250
250
  get() {
251
- return descriptor.get?.call(this) ?? getDefaultValue();
251
+ let value = descriptor.get?.call(this);
252
+ if (value === void 0) {
253
+ value = getDefaultValue();
254
+ if (value !== void 0) {
255
+ descriptor.set?.call(this, value);
256
+ }
257
+ }
258
+ return value;
252
259
  },
253
260
  set(value) {
254
- const oldValue = descriptor.get?.call(this) ?? getDefaultValue();
261
+ let oldValue = descriptor.get?.call(this);
262
+ if (oldValue === void 0) {
263
+ oldValue = getDefaultValue();
264
+ }
255
265
  descriptor.set?.call(this, value);
256
266
  this.requestUpdate?.(name, oldValue, declaration);
257
267
  },
@@ -6058,7 +6068,7 @@ exports.Node = class Node extends CoreObject {
6058
6068
  removeChild(child) {
6059
6069
  const index = child.getIndex();
6060
6070
  if (this.is(child.parent) && index > -1) {
6061
- this._children.internal.splice(index, 1);
6071
+ this._children.getInternal(child.internalMode).splice(index, 1);
6062
6072
  child.setParent(void 0);
6063
6073
  this.emit("removeChild", child, index);
6064
6074
  }
@@ -9514,7 +9524,7 @@ exports.Node2D = class Node2D extends exports.CanvasItem {
9514
9524
  _process(delta) {
9515
9525
  super._process(delta);
9516
9526
  const parent = this.getParent();
9517
- if (this._parentTransformDirtyId !== parent?.globalTransform?.dirtyId) {
9527
+ if (parent?.globalTransform && this._parentTransformDirtyId !== parent?.globalTransform?.dirtyId) {
9518
9528
  this.requestRelayout();
9519
9529
  }
9520
9530
  }