modern-canvas 0.4.14 → 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
@@ -4383,13 +4383,12 @@ function parseCSSFilter(filter) {
4383
4383
  return m;
4384
4384
  }
4385
4385
 
4386
- const _temp = new Transform2D();
4387
4386
  function parseCSSTransform(transform, width, height) {
4388
4387
  const t2d = new Transform2D(false);
4389
4388
  transform = !transform || transform === "none" ? "" : transform;
4390
4389
  parseCssFunctions(transform, { width, height }).forEach(({ name, args }) => {
4391
4390
  const values = args.map((arg) => arg.normalizedIntValue);
4392
- _temp.identity();
4391
+ const _temp = new Transform2D();
4393
4392
  switch (name) {
4394
4393
  case "translate":
4395
4394
  _temp.translate(values[0] * width, (values[1] ?? values[0]) * height);
@@ -5818,6 +5817,22 @@ let Node = class extends CoreObject {
5818
5817
  const tree = this._tree;
5819
5818
  const canRender = this.canRender();
5820
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
+ });
5821
5836
  if (canProcess) {
5822
5837
  tree?.emit("nodeProcessing", this);
5823
5838
  this.emit("processing", delta);
@@ -5840,9 +5855,9 @@ let Node = class extends CoreObject {
5840
5855
  this.removeChild(mask);
5841
5856
  }
5842
5857
  }
5843
- for (let len = this._children.length, i = 0; i < len; i++) {
5844
- this._children[i].emit("process", delta);
5845
- }
5858
+ childrenInAfter.forEach((child) => {
5859
+ child.emit("process", delta);
5860
+ });
5846
5861
  if (canRender) {
5847
5862
  tree.renderStack.currentCall = oldRenderCall;
5848
5863
  }
@@ -6110,6 +6125,9 @@ __decorateClass$I([
6110
6125
  __decorateClass$I([
6111
6126
  property({ default: "inherit" })
6112
6127
  ], Node.prototype, "processMode", 2);
6128
+ __decorateClass$I([
6129
+ property({ default: "default" })
6130
+ ], Node.prototype, "processSortMode", 2);
6113
6131
  __decorateClass$I([
6114
6132
  property({ default: "inherit" })
6115
6133
  ], Node.prototype, "renderMode", 2);
@@ -10171,19 +10189,14 @@ let Animation = class extends TimelineNode {
10171
10189
  _stoped = false;
10172
10190
  constructor(properties, children = []) {
10173
10191
  super();
10174
- this._process = this._process.bind(this);
10175
10192
  this.setProperties(properties).append(children);
10176
10193
  }
10177
- _treeEnter(tree) {
10178
- tree.timeline.on("updateCurrentTime", this._process);
10194
+ _treeEnter(_tree) {
10179
10195
  this._updateCachedProps();
10180
10196
  }
10181
- _treeExit(oldTree) {
10182
- oldTree.timeline.on("updateCurrentTime", this._process);
10197
+ _treeExit(_oldTree) {
10183
10198
  this.cancel();
10184
10199
  }
10185
- _onProcess() {
10186
- }
10187
10200
  _process() {
10188
10201
  if (this.canProcess()) {
10189
10202
  this.commitStyles();
@@ -10442,6 +10455,7 @@ Animation = __decorateClass$d([
10442
10455
  customNode("Animation", {
10443
10456
  renderMode: "disabled",
10444
10457
  processMode: "pausable",
10458
+ processSortMode: "parent_before",
10445
10459
  duration: 2e3
10446
10460
  })
10447
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.14",
4
+ "version": "0.4.16",
5
5
  "packageManager": "pnpm@9.15.1",
6
6
  "description": "A JavaScript WebGL rendering engine.",
7
7
  "author": "wxm",