@leafer-game/miniapp 2.3.2 → 2.3.4

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.
@@ -1740,6 +1740,7 @@ const Platform = {
1740
1740
  if (fileType === "text") url = "data:text/plain;charset=utf-8," + url; else if (fileType === "svg") url = "data:image/svg+xml," + url;
1741
1741
  return url;
1742
1742
  },
1743
+ origin: {},
1743
1744
  image: {
1744
1745
  hitCanvasSize: 100,
1745
1746
  maxCacheSize: 2560 * 1600,
@@ -4902,6 +4903,7 @@ const LeafHelper = {
4902
4903
  updateComplex(_leaf) {},
4903
4904
  checkComplex(_leaf) {},
4904
4905
  updateFlowLayout(_leaf) {},
4906
+ listenPositionNode(_leaf) {},
4905
4907
  updatePositionLayout(_leaf) {},
4906
4908
  moveWorld(t, x, y = 0, isInnerPoint, transition) {
4907
4909
  const local = isObject(x) ? Object.assign({}, x) : {
@@ -6161,7 +6163,10 @@ const LeafBounds = {
6161
6163
  layout.resized = "inner";
6162
6164
  }
6163
6165
  if (layout.localBoxChanged) {
6164
- if (this.__local) this.__updateLocalBoxBounds();
6166
+ if (this.__local) {
6167
+ this.__updateLocalBoxBounds();
6168
+ if (data.__usePositionNode) LeafHelper.listenPositionNode(this);
6169
+ }
6165
6170
  layout.localBoxChanged = undefined;
6166
6171
  if (layout.strokeSpread && !layout.strokeChanged) layout.strokeChanged = layout.boxChanged ? true : 2;
6167
6172
  if (layout.renderSpread && !layout.renderChanged) layout.renderChanged = layout.boxChanged ? true : 2;
@@ -7077,7 +7082,7 @@ class LeafLevelList {
7077
7082
  }
7078
7083
  }
7079
7084
 
7080
- const version = "2.3.2";
7085
+ const version = "2.3.4";
7081
7086
 
7082
7087
  if (typeof globalThis !== "undefined") {
7083
7088
  const globalLeafer = globalThis.Leafer || (globalThis.Leafer = {});
@@ -7195,7 +7200,7 @@ Object.assign(Creator, {
7195
7200
  });
7196
7201
 
7197
7202
  function useCanvas(_canvasType, app) {
7198
- Platform.origin = {
7203
+ Object.assign(Platform.origin, {
7199
7204
  createCanvas: (width, height, _format) => {
7200
7205
  const data = {
7201
7206
  type: "2d",
@@ -7264,7 +7269,7 @@ function useCanvas(_canvasType, app) {
7264
7269
  }));
7265
7270
  },
7266
7271
  noRepeat: "repeat-x"
7267
- };
7272
+ });
7268
7273
  Platform.miniapp = {
7269
7274
  select(name) {
7270
7275
  return app.createSelectorQuery().select(name);
@@ -7405,6 +7410,7 @@ class Watcher {
7405
7410
  this.add(event.target);
7406
7411
  }
7407
7412
  add(leaf) {
7413
+ if (!this.target) return;
7408
7414
  if (this.config.usePartLayout) this.__updatedList.add(leaf);
7409
7415
  this.update();
7410
7416
  }