@leafer-draw/worker 2.3.3 → 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,
@@ -7080,7 +7081,7 @@ class LeafLevelList {
7080
7081
  }
7081
7082
  }
7082
7083
 
7083
- const version = "2.3.3";
7084
+ const version = "2.3.4";
7084
7085
 
7085
7086
  if (typeof globalThis !== "undefined") {
7086
7087
  const globalLeafer = globalThis.Leafer || (globalThis.Leafer = {});
@@ -7118,7 +7119,7 @@ Object.assign(Creator, {
7118
7119
  });
7119
7120
 
7120
7121
  function useCanvas(_canvasType, _power) {
7121
- Platform.origin = {
7122
+ Object.assign(Platform.origin, {
7122
7123
  createCanvas: (width, height) => new OffscreenCanvas(width, height),
7123
7124
  canvasToDataURL: (canvas, type, quality) => new Promise((resolve, reject) => {
7124
7125
  canvas.convertToBlob({
@@ -7164,7 +7165,7 @@ function useCanvas(_canvasType, _power) {
7164
7165
  return yield response[responseType]();
7165
7166
  });
7166
7167
  }
7167
- };
7168
+ });
7168
7169
  Platform.canvas = Creator.canvas();
7169
7170
  Platform.conicGradientSupport = !!Platform.canvas.context.createConicGradient;
7170
7171
  }
@@ -7249,6 +7250,7 @@ class Watcher {
7249
7250
  this.add(event.target);
7250
7251
  }
7251
7252
  add(leaf) {
7253
+ if (!this.target) return;
7252
7254
  if (this.config.usePartLayout) this.__updatedList.add(leaf);
7253
7255
  this.update();
7254
7256
  }