modern-canvas 0.4.15 → 0.4.16

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.mjs CHANGED
@@ -5817,6 +5817,22 @@ let Node = class extends CoreObject {
5817
5817
  const tree = this._tree;
5818
5818
  const canRender = this.canRender();
5819
5819
  const canProcess = this.canProcess();
5820
+ const childrenInBefore = [];
5821
+ const childrenInAfter = [];
5822
+ for (let len = this._children.length, i = 0; i < len; i++) {
5823
+ const child = this._children[i];
5824
+ switch (child.processSortMode) {
5825
+ case "default":
5826
+ childrenInAfter.push(child);
5827
+ break;
5828
+ case "parent_before":
5829
+ childrenInBefore.push(child);
5830
+ break;
5831
+ }
5832
+ }
5833
+ childrenInBefore.forEach((child) => {
5834
+ child.emit("process", delta);
5835
+ });
5820
5836
  if (canProcess) {
5821
5837
  tree?.emit("nodeProcessing", this);
5822
5838
  this.emit("processing", delta);
@@ -5839,9 +5855,9 @@ let Node = class extends CoreObject {
5839
5855
  this.removeChild(mask);
5840
5856
  }
5841
5857
  }
5842
- for (let len = this._children.length, i = 0; i < len; i++) {
5843
- this._children[i].emit("process", delta);
5844
- }
5858
+ childrenInAfter.forEach((child) => {
5859
+ child.emit("process", delta);
5860
+ });
5845
5861
  if (canRender) {
5846
5862
  tree.renderStack.currentCall = oldRenderCall;
5847
5863
  }
@@ -6109,6 +6125,9 @@ __decorateClass$I([
6109
6125
  __decorateClass$I([
6110
6126
  property({ default: "inherit" })
6111
6127
  ], Node.prototype, "processMode", 2);
6128
+ __decorateClass$I([
6129
+ property({ default: "default" })
6130
+ ], Node.prototype, "processSortMode", 2);
6112
6131
  __decorateClass$I([
6113
6132
  property({ default: "inherit" })
6114
6133
  ], Node.prototype, "renderMode", 2);
@@ -10170,19 +10189,14 @@ let Animation = class extends TimelineNode {
10170
10189
  _stoped = false;
10171
10190
  constructor(properties, children = []) {
10172
10191
  super();
10173
- this._process = this._process.bind(this);
10174
10192
  this.setProperties(properties).append(children);
10175
10193
  }
10176
- _treeEnter(tree) {
10177
- tree.timeline.on("updateCurrentTime", this._process);
10194
+ _treeEnter(_tree) {
10178
10195
  this._updateCachedProps();
10179
10196
  }
10180
- _treeExit(oldTree) {
10181
- oldTree.timeline.on("updateCurrentTime", this._process);
10197
+ _treeExit(_oldTree) {
10182
10198
  this.cancel();
10183
10199
  }
10184
- _onProcess() {
10185
- }
10186
10200
  _process() {
10187
10201
  if (this.canProcess()) {
10188
10202
  this.commitStyles();
@@ -10441,6 +10455,7 @@ Animation = __decorateClass$d([
10441
10455
  customNode("Animation", {
10442
10456
  renderMode: "disabled",
10443
10457
  processMode: "pausable",
10458
+ processSortMode: "parent_before",
10444
10459
  duration: 2e3
10445
10460
  })
10446
10461
  ], Animation);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "modern-canvas",
3
3
  "type": "module",
4
- "version": "0.4.15",
4
+ "version": "0.4.16",
5
5
  "packageManager": "pnpm@9.15.1",
6
6
  "description": "A JavaScript WebGL rendering engine.",
7
7
  "author": "wxm",