rendx-engine 0.4.0 → 0.4.1

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/main.cjs CHANGED
@@ -612,6 +612,7 @@ var Graphics = class extends EventTarget {
612
612
  const node = this.children[index];
613
613
  this.children.splice(index, 1);
614
614
  __privateMethod(this, _Graphics_instances, removeFromNameMap_fn).call(this, node);
615
+ node.parent = null;
615
616
  this.setDirty(true);
616
617
  }
617
618
  return this;
@@ -798,8 +799,9 @@ var Graphics = class extends EventTarget {
798
799
  }
799
800
  /** 检查是否需要重绘(自身或子树有脏标记/更新标记) */
800
801
  sign() {
802
+ if (this.dirty) return true;
801
803
  if (!this.display) return false;
802
- if (this.dirty || this.needUpdate || this.worldMatrixNeedUpdate) return true;
804
+ if (this.needUpdate || this.worldMatrixNeedUpdate) return true;
803
805
  for (let i = 0; i < this.children.length; i++) if (this.children[i].sign()) return true;
804
806
  return false;
805
807
  }
@@ -1218,7 +1220,7 @@ var Scene = class extends Graphics {
1218
1220
  });
1219
1221
  }
1220
1222
  queue.sort((a, b) => a.ez - b.ez);
1221
- this.setDirty(false);
1223
+ this.dirty = false;
1222
1224
  __privateSet(this, _queue, queue);
1223
1225
  }
1224
1226
  return __privateGet(this, _queue);
@@ -2241,7 +2243,7 @@ var Layer = class extends Group {
2241
2243
  if (node.type === 3) queue.push(node);
2242
2244
  });
2243
2245
  queue.sort((a, b) => a.ez - b.ez);
2244
- this.setDirty(false);
2246
+ this.dirty = false;
2245
2247
  __privateSet(this, _queue2, queue);
2246
2248
  }
2247
2249
  return __privateGet(this, _queue2);
@@ -2256,6 +2258,7 @@ var Layer = class extends Group {
2256
2258
  if (this.isEventLayer) return;
2257
2259
  this.update();
2258
2260
  const queue = this.getQueue();
2261
+ this.setDirty(false);
2259
2262
  this.renderer.draw(this.culling ? __privateMethod(this, _Layer_instances, cullViewport_fn).call(this, queue) : queue);
2260
2263
  }
2261
2264
  resize(size) {
package/dist/main.js CHANGED
@@ -538,6 +538,7 @@ var Graphics = class extends EventTarget {
538
538
  const node = this.children[index];
539
539
  this.children.splice(index, 1);
540
540
  __privateMethod(this, _Graphics_instances, removeFromNameMap_fn).call(this, node);
541
+ node.parent = null;
541
542
  this.setDirty(true);
542
543
  }
543
544
  return this;
@@ -724,8 +725,9 @@ var Graphics = class extends EventTarget {
724
725
  }
725
726
  /** 检查是否需要重绘(自身或子树有脏标记/更新标记) */
726
727
  sign() {
728
+ if (this.dirty) return true;
727
729
  if (!this.display) return false;
728
- if (this.dirty || this.needUpdate || this.worldMatrixNeedUpdate) return true;
730
+ if (this.needUpdate || this.worldMatrixNeedUpdate) return true;
729
731
  for (let i = 0; i < this.children.length; i++) if (this.children[i].sign()) return true;
730
732
  return false;
731
733
  }
@@ -1144,7 +1146,7 @@ var Scene = class extends Graphics {
1144
1146
  });
1145
1147
  }
1146
1148
  queue.sort((a, b) => a.ez - b.ez);
1147
- this.setDirty(false);
1149
+ this.dirty = false;
1148
1150
  __privateSet(this, _queue, queue);
1149
1151
  }
1150
1152
  return __privateGet(this, _queue);
@@ -2167,7 +2169,7 @@ var Layer = class extends Group {
2167
2169
  if (node.type === 3) queue.push(node);
2168
2170
  });
2169
2171
  queue.sort((a, b) => a.ez - b.ez);
2170
- this.setDirty(false);
2172
+ this.dirty = false;
2171
2173
  __privateSet(this, _queue2, queue);
2172
2174
  }
2173
2175
  return __privateGet(this, _queue2);
@@ -2182,6 +2184,7 @@ var Layer = class extends Group {
2182
2184
  if (this.isEventLayer) return;
2183
2185
  this.update();
2184
2186
  const queue = this.getQueue();
2187
+ this.setDirty(false);
2185
2188
  this.renderer.draw(this.culling ? __privateMethod(this, _Layer_instances, cullViewport_fn).call(this, queue) : queue);
2186
2189
  }
2187
2190
  resize(size) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rendx-engine",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "2D scene graph engine with animation, events, and plugin system",
5
5
  "license": "MIT",
6
6
  "author": "wei.liang (https://github.com/weiliang0121)",