@leafer-draw/worker 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.
@@ -1779,6 +1779,7 @@ const Platform = {
1779
1779
  if (fileType === "text") url = "data:text/plain;charset=utf-8," + url; else if (fileType === "svg") url = "data:image/svg+xml," + url;
1780
1780
  return url;
1781
1781
  },
1782
+ origin: {},
1782
1783
  image: {
1783
1784
  hitCanvasSize: 100,
1784
1785
  maxCacheSize: 2560 * 1600,
@@ -4901,6 +4902,7 @@ const LeafHelper = {
4901
4902
  updateComplex(_leaf) {},
4902
4903
  checkComplex(_leaf) {},
4903
4904
  updateFlowLayout(_leaf) {},
4905
+ listenPositionNode(_leaf) {},
4904
4906
  updatePositionLayout(_leaf) {},
4905
4907
  moveWorld(t, x, y = 0, isInnerPoint, transition) {
4906
4908
  const local = isObject(x) ? Object.assign({}, x) : {
@@ -6160,7 +6162,10 @@ const LeafBounds = {
6160
6162
  layout.resized = "inner";
6161
6163
  }
6162
6164
  if (layout.localBoxChanged) {
6163
- if (this.__local) this.__updateLocalBoxBounds();
6165
+ if (this.__local) {
6166
+ this.__updateLocalBoxBounds();
6167
+ if (data.__usePositionNode) LeafHelper.listenPositionNode(this);
6168
+ }
6164
6169
  layout.localBoxChanged = undefined;
6165
6170
  if (layout.strokeSpread && !layout.strokeChanged) layout.strokeChanged = layout.boxChanged ? true : 2;
6166
6171
  if (layout.renderSpread && !layout.renderChanged) layout.renderChanged = layout.boxChanged ? true : 2;
@@ -7076,7 +7081,7 @@ class LeafLevelList {
7076
7081
  }
7077
7082
  }
7078
7083
 
7079
- const version = "2.3.2";
7084
+ const version = "2.3.4";
7080
7085
 
7081
7086
  if (typeof globalThis !== "undefined") {
7082
7087
  const globalLeafer = globalThis.Leafer || (globalThis.Leafer = {});
@@ -7114,7 +7119,7 @@ Object.assign(Creator, {
7114
7119
  });
7115
7120
 
7116
7121
  function useCanvas(_canvasType, _power) {
7117
- Platform.origin = {
7122
+ Object.assign(Platform.origin, {
7118
7123
  createCanvas: (width, height) => new OffscreenCanvas(width, height),
7119
7124
  canvasToDataURL: (canvas, type, quality) => new Promise((resolve, reject) => {
7120
7125
  canvas.convertToBlob({
@@ -7160,7 +7165,7 @@ function useCanvas(_canvasType, _power) {
7160
7165
  return yield response[responseType]();
7161
7166
  });
7162
7167
  }
7163
- };
7168
+ });
7164
7169
  Platform.canvas = Creator.canvas();
7165
7170
  Platform.conicGradientSupport = !!Platform.canvas.context.createConicGradient;
7166
7171
  }
@@ -7245,6 +7250,7 @@ class Watcher {
7245
7250
  this.add(event.target);
7246
7251
  }
7247
7252
  add(leaf) {
7253
+ if (!this.target) return;
7248
7254
  if (this.config.usePartLayout) this.__updatedList.add(leaf);
7249
7255
  this.update();
7250
7256
  }