@leafer/worker 1.12.3 → 2.0.0

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.
@@ -216,57 +216,6 @@ class LeafData {
216
216
  }
217
217
  }
218
218
 
219
- const {floor: floor$3, max: max$7} = Math;
220
-
221
- const Platform = {
222
- toURL(text, fileType) {
223
- let url = encodeURIComponent(text);
224
- if (fileType === "text") url = "data:text/plain;charset=utf-8," + url; else if (fileType === "svg") url = "data:image/svg+xml," + url;
225
- return url;
226
- },
227
- image: {
228
- hitCanvasSize: 100,
229
- maxCacheSize: 2560 * 1600,
230
- maxPatternSize: 4096 * 2160,
231
- crossOrigin: "anonymous",
232
- isLarge(size, scaleX, scaleY, largeSize) {
233
- return size.width * size.height * (scaleX ? scaleX * scaleY : 1) > (largeSize || image$1.maxCacheSize);
234
- },
235
- isSuperLarge(size, scaleX, scaleY) {
236
- return image$1.isLarge(size, scaleX, scaleY, image$1.maxPatternSize);
237
- },
238
- getRealURL(url) {
239
- const {prefix: prefix, suffix: suffix} = Platform.image;
240
- if (suffix && !url.startsWith("data:") && !url.startsWith("blob:")) url += (url.includes("?") ? "&" : "?") + suffix;
241
- if (prefix && url[0] === "/") url = prefix + url;
242
- return url;
243
- },
244
- resize(image, width, height, xGap, yGap, clip, smooth, opacity, _filters) {
245
- const canvas = Platform.origin.createCanvas(max$7(floor$3(width + (xGap || 0)), 1), max$7(floor$3(height + (yGap || 0)), 1));
246
- const ctx = canvas.getContext("2d");
247
- if (opacity) ctx.globalAlpha = opacity;
248
- ctx.imageSmoothingEnabled = smooth === false ? false : true;
249
- if (clip) {
250
- const scaleX = width / clip.width, scaleY = height / clip.height;
251
- ctx.setTransform(scaleX, 0, 0, scaleY, -clip.x * scaleX, -clip.y * scaleY);
252
- ctx.drawImage(image, 0, 0, image.width, image.height);
253
- } else ctx.drawImage(image, 0, 0, width, height);
254
- return canvas;
255
- },
256
- setPatternTransform(pattern, transform, paint) {
257
- try {
258
- if (transform && pattern.setTransform) {
259
- pattern.setTransform(transform);
260
- transform = undefined;
261
- }
262
- } catch (_a) {}
263
- if (paint) DataHelper.stintSet(paint, "transform", transform);
264
- }
265
- }
266
- };
267
-
268
- const {image: image$1} = Platform;
269
-
270
219
  const IncrementId = {
271
220
  RUNTIME: "runtime",
272
221
  LEAF: "leaf",
@@ -289,7 +238,7 @@ const I$2 = IncrementId;
289
238
 
290
239
  let tempA, tempB, tempTo;
291
240
 
292
- const {max: max$6} = Math, tempFour = [ 0, 0, 0, 0 ];
241
+ const {max: max$7} = Math, tempFour = [ 0, 0, 0, 0 ];
293
242
 
294
243
  const FourNumberHelper = {
295
244
  zero: [ ...tempFour ],
@@ -341,9 +290,9 @@ const FourNumberHelper = {
341
290
  return data;
342
291
  },
343
292
  max(t, other, change) {
344
- if (isNumber(t) && isNumber(other)) return max$6(t, other);
293
+ if (isNumber(t) && isNumber(other)) return max$7(t, other);
345
294
  toTempAB(t, other, change);
346
- return set$2(tempTo, max$6(tempA[0], tempB[0]), max$6(tempA[1], tempB[1]), max$6(tempA[2], tempB[2]), max$6(tempA[3], tempB[3]));
295
+ return set$2(tempTo, max$7(tempA[0], tempB[0]), max$7(tempA[1], tempB[1]), max$7(tempA[2], tempB[2]), max$7(tempA[3], tempB[3]));
347
296
  },
348
297
  add(t, other, change) {
349
298
  if (isNumber(t) && isNumber(other)) return t + other;
@@ -360,7 +309,7 @@ const FourNumberHelper = {
360
309
 
361
310
  const {set: set$2, get: get$5, setTemp: setTemp, toTempAB: toTempAB} = FourNumberHelper;
362
311
 
363
- const {round: round$6, pow: pow$2, max: max$5, floor: floor$2, PI: PI$4} = Math;
312
+ const {round: round$6, pow: pow$2, max: max$6, floor: floor$3, PI: PI$4} = Math;
364
313
 
365
314
  const MathHelper = {
366
315
  within(value, min, max) {
@@ -414,7 +363,7 @@ const MathHelper = {
414
363
  }
415
364
  },
416
365
  getFloorScale(num, min = 1) {
417
- return max$5(floor$2(num), min) / num;
366
+ return max$6(floor$3(num), min) / num;
418
367
  },
419
368
  randInt: randInt,
420
369
  randColor(opacity) {
@@ -1259,7 +1208,7 @@ const {toOuterPoint: toOuterPoint$2} = MatrixHelper;
1259
1208
 
1260
1209
  const {float: float$3, fourNumber: fourNumber$1} = MathHelper;
1261
1210
 
1262
- const {floor: floor$1, ceil: ceil$2} = Math;
1211
+ const {floor: floor$2, ceil: ceil$2} = Math;
1263
1212
 
1264
1213
  let right$4, bottom$3, boundsRight, boundsBottom;
1265
1214
 
@@ -1416,8 +1365,8 @@ const BoundsHelper = {
1416
1365
  },
1417
1366
  ceil(t) {
1418
1367
  const {x: x, y: y} = t;
1419
- t.x = floor$1(t.x);
1420
- t.y = floor$1(t.y);
1368
+ t.x = floor$2(t.x);
1369
+ t.y = floor$2(t.y);
1421
1370
  t.width = x > t.x ? ceil$2(t.width + x - t.x) : ceil$2(t.width);
1422
1371
  t.height = y > t.y ? ceil$2(t.height + y - t.y) : ceil$2(t.height);
1423
1372
  },
@@ -1549,6 +1498,9 @@ const BoundsHelper = {
1549
1498
  isEmpty(t) {
1550
1499
  return t.x === 0 && t.y === 0 && t.width === 0 && t.height === 0;
1551
1500
  },
1501
+ hasSize(t) {
1502
+ return t.width && t.height;
1503
+ },
1552
1504
  reset(t) {
1553
1505
  B.set(t);
1554
1506
  }
@@ -1725,6 +1677,12 @@ class AutoBounds {
1725
1677
  }
1726
1678
  }
1727
1679
 
1680
+ const UnitConvertHelper = {
1681
+ number(value, percentRefer) {
1682
+ return isObject(value) ? value.type === "percent" ? value.value * percentRefer : value.value : value;
1683
+ }
1684
+ };
1685
+
1728
1686
  const StringNumberMap = {
1729
1687
  0: 1,
1730
1688
  1: 1,
@@ -1741,6 +1699,69 @@ const StringNumberMap = {
1741
1699
  E: 1
1742
1700
  };
1743
1701
 
1702
+ const {floor: floor$1, max: max$5} = Math;
1703
+
1704
+ const Platform = {
1705
+ toURL(text, fileType) {
1706
+ let url = encodeURIComponent(text);
1707
+ if (fileType === "text") url = "data:text/plain;charset=utf-8," + url; else if (fileType === "svg") url = "data:image/svg+xml," + url;
1708
+ return url;
1709
+ },
1710
+ image: {
1711
+ hitCanvasSize: 100,
1712
+ maxCacheSize: 2560 * 1600,
1713
+ maxPatternSize: 4096 * 2160,
1714
+ crossOrigin: "anonymous",
1715
+ isLarge(size, scaleX, scaleY, largeSize) {
1716
+ return size.width * size.height * (scaleX ? scaleX * scaleY : 1) > (largeSize || image$1.maxCacheSize);
1717
+ },
1718
+ isSuperLarge(size, scaleX, scaleY) {
1719
+ return image$1.isLarge(size, scaleX, scaleY, image$1.maxPatternSize);
1720
+ },
1721
+ getRealURL(url) {
1722
+ const {prefix: prefix, suffix: suffix} = image$1;
1723
+ if (suffix && !url.startsWith("data:") && !url.startsWith("blob:")) url += (url.includes("?") ? "&" : "?") + suffix;
1724
+ if (prefix && url[0] === "/") url = prefix + url;
1725
+ return url;
1726
+ },
1727
+ resize(view, width, height, xGap, yGap, clip, smooth, opacity, _filters, interlace) {
1728
+ const realWidth = max$5(floor$1(width + (xGap || 0)), 1), realHeight = max$5(floor$1(height + (yGap || 0)), 1);
1729
+ let interlaceX, interlaceY, interlaceOffset;
1730
+ if (interlace && (interlaceOffset = UnitConvertHelper.number(interlace.offset, (interlaceX = interlace.type === "x") ? width : height))) interlaceX || (interlaceY = true);
1731
+ const canvas = Platform.origin.createCanvas(interlaceY ? realWidth * 2 : realWidth, interlaceX ? realHeight * 2 : realHeight);
1732
+ const ctx = canvas.getContext("2d");
1733
+ if (opacity) ctx.globalAlpha = opacity;
1734
+ ctx.imageSmoothingEnabled = smooth === false ? false : true;
1735
+ if (image$1.canUse(view)) {
1736
+ if (clip) {
1737
+ const scaleX = width / clip.width, scaleY = height / clip.height;
1738
+ ctx.setTransform(scaleX, 0, 0, scaleY, -clip.x * scaleX, -clip.y * scaleY);
1739
+ ctx.drawImage(view, 0, 0, view.width, view.height);
1740
+ } else ctx.drawImage(view, 0, 0, width, height);
1741
+ if (interlaceOffset) {
1742
+ ctx.drawImage(canvas, 0, 0, realWidth, realHeight, interlaceX ? interlaceOffset - realWidth : realWidth, interlaceX ? realHeight : interlaceOffset - realHeight, realWidth, realHeight);
1743
+ ctx.drawImage(canvas, 0, 0, realWidth, realHeight, interlaceX ? interlaceOffset : realWidth, interlaceX ? realHeight : interlaceOffset, realWidth, realHeight);
1744
+ }
1745
+ }
1746
+ return canvas;
1747
+ },
1748
+ canUse(view) {
1749
+ return view && view.width && !view.__closed;
1750
+ },
1751
+ setPatternTransform(pattern, transform, paint) {
1752
+ try {
1753
+ if (transform && pattern.setTransform) {
1754
+ pattern.setTransform(transform);
1755
+ transform = undefined;
1756
+ }
1757
+ } catch (_a) {}
1758
+ if (paint) DataHelper.stintSet(paint, "transform", transform);
1759
+ }
1760
+ }
1761
+ };
1762
+
1763
+ const {image: image$1} = Platform;
1764
+
1744
1765
  const {randColor: randColor} = MathHelper;
1745
1766
 
1746
1767
  class Debug {
@@ -3783,9 +3804,10 @@ class TaskItem {
3783
3804
  run() {
3784
3805
  return __awaiter(this, void 0, void 0, function*() {
3785
3806
  try {
3786
- if (this.isComplete) return;
3807
+ if (this.isComplete || this.runing) return;
3808
+ this.runing = true;
3787
3809
  if (this.canUse && !this.canUse()) return this.cancel();
3788
- if (this.task && this.parent.running) yield this.task();
3810
+ if (this.task) yield this.task();
3789
3811
  } catch (error) {
3790
3812
  debug$c.error(error);
3791
3813
  }
@@ -3901,7 +3923,7 @@ class TaskProcessor {
3901
3923
  stop() {
3902
3924
  this.isComplete = true;
3903
3925
  this.list.forEach(task => {
3904
- if (!task.isComplete) task.cancel();
3926
+ if (!task.isComplete) task.run();
3905
3927
  });
3906
3928
  this.pause();
3907
3929
  this.empty();
@@ -4191,7 +4213,7 @@ class LeaferImage {
4191
4213
  getFull(_filters) {
4192
4214
  return this.view;
4193
4215
  }
4194
- getCanvas(width, height, opacity, filters, xGap, yGap, smooth) {
4216
+ getCanvas(width, height, opacity, filters, xGap, yGap, smooth, interlace) {
4195
4217
  width || (width = this.width);
4196
4218
  height || (height = this.height);
4197
4219
  if (this.cache) {
@@ -4204,7 +4226,7 @@ class LeaferImage {
4204
4226
  }
4205
4227
  if (data) return data;
4206
4228
  }
4207
- const canvas = Platform.image.resize(this.view, width, height, xGap, yGap, undefined, smooth, opacity, filters);
4229
+ const canvas = Platform.image.resize(this.view, width, height, xGap, yGap, undefined, smooth, opacity, filters, interlace);
4208
4230
  this.cache = this.use > 1 ? {
4209
4231
  data: canvas,
4210
4232
  params: arguments
@@ -4220,13 +4242,13 @@ class LeaferImage {
4220
4242
  return this.url;
4221
4243
  }
4222
4244
  setThumbView(_view) {}
4223
- getThumbSize() {
4245
+ getThumbSize(_lod) {
4224
4246
  return undefined;
4225
4247
  }
4226
4248
  getMinLevel() {
4227
4249
  return undefined;
4228
4250
  }
4229
- getLevelData(_level) {
4251
+ getLevelData(_level, _width, _height) {
4230
4252
  return undefined;
4231
4253
  }
4232
4254
  clearLevels(_checkUse) {}
@@ -6096,7 +6118,7 @@ const LeafRender = {
6096
6118
  }
6097
6119
  };
6098
6120
 
6099
- const {excludeRenderBounds: excludeRenderBounds$1} = LeafBoundsHelper;
6121
+ const {excludeRenderBounds: excludeRenderBounds$1} = LeafBoundsHelper, {hasSize: hasSize} = BoundsHelper;
6100
6122
 
6101
6123
  const BranchRender = {
6102
6124
  __updateChange() {
@@ -6108,8 +6130,8 @@ const BranchRender = {
6108
6130
  this.__.__checkSingle();
6109
6131
  },
6110
6132
  __render(canvas, options) {
6111
- this.__nowWorld = this.__getNowWorld(options);
6112
- if (this.__worldOpacity) {
6133
+ const nowWorld = this.__nowWorld = this.__getNowWorld(options);
6134
+ if (this.__worldOpacity && hasSize(nowWorld)) {
6113
6135
  const data = this.__;
6114
6136
  if (data.__useDim) {
6115
6137
  if (data.dim) options.dimOpacity = data.dim === true ? .2 : data.dim; else if (data.bright && !options.topRendering) return options.topList.add(this); else if (data.dimskip) options.dimOpacity && (options.dimOpacity = 0);
@@ -6118,7 +6140,6 @@ const BranchRender = {
6118
6140
  if (data.eraser === "path") return this.__renderEraser(canvas, options);
6119
6141
  const tempCanvas = canvas.getSameCanvas(false, true);
6120
6142
  this.__renderBranch(tempCanvas, options);
6121
- const nowWorld = this.__nowWorld;
6122
6143
  canvas.opacity = options.dimOpacity ? data.opacity * options.dimOpacity : data.opacity;
6123
6144
  canvas.copyWorldByReset(tempCanvas, nowWorld, nowWorld, data.__blendMode, true);
6124
6145
  tempCanvas.recycle(nowWorld);
@@ -6958,7 +6979,7 @@ class LeafLevelList {
6958
6979
  }
6959
6980
  }
6960
6981
 
6961
- const version = "1.12.3";
6982
+ const version = "2.0.0";
6962
6983
 
6963
6984
  class LeaferCanvas extends LeaferCanvasBase {
6964
6985
  get allowBackgroundColor() {
@@ -7385,6 +7406,7 @@ class Renderer {
7385
7406
  this.times = 0;
7386
7407
  this.config = {
7387
7408
  usePartRender: true,
7409
+ ceilPartPixel: true,
7388
7410
  maxFPS: 120
7389
7411
  };
7390
7412
  this.frames = [];
@@ -7493,8 +7515,9 @@ class Renderer {
7493
7515
  const {canvas: canvas} = this, bounds = block.getIntersect(canvas.bounds), realBounds = new Bounds(bounds);
7494
7516
  canvas.save();
7495
7517
  bounds.spread(Renderer.clipSpread).ceil();
7496
- canvas.clearWorld(bounds);
7497
- canvas.clipWorld(bounds);
7518
+ const {ceilPartPixel: ceilPartPixel} = this.config;
7519
+ canvas.clipWorld(bounds, ceilPartPixel);
7520
+ canvas.clearWorld(bounds, ceilPartPixel);
7498
7521
  this.__render(bounds, realBounds);
7499
7522
  canvas.restore();
7500
7523
  Run.end(t);
@@ -7893,11 +7916,7 @@ const ColorConvert = {
7893
7916
  hasTransparent: hasTransparent$3
7894
7917
  };
7895
7918
 
7896
- const UnitConvert = {
7897
- number(value, percentRefer) {
7898
- return isObject(value) ? value.type === "percent" ? value.value * percentRefer : value.value : value;
7899
- }
7900
- };
7919
+ const UnitConvert = UnitConvertHelper;
7901
7920
 
7902
7921
  const PathArrow = {};
7903
7922
 
@@ -9267,9 +9286,10 @@ let Ellipse = class Ellipse extends UI {
9267
9286
  const {width: width, height: height, innerRadius: innerRadius, startAngle: startAngle, endAngle: endAngle} = this.__;
9268
9287
  const rx = width / 2, ry = height / 2;
9269
9288
  const path = this.__.path = [];
9289
+ let open;
9270
9290
  if (innerRadius) {
9271
9291
  if (startAngle || endAngle) {
9272
- if (innerRadius < 1) ellipse(path, rx, ry, rx * innerRadius, ry * innerRadius, 0, startAngle, endAngle, false);
9292
+ if (innerRadius < 1) ellipse(path, rx, ry, rx * innerRadius, ry * innerRadius, 0, startAngle, endAngle, false); else open = true;
9273
9293
  ellipse(path, rx, ry, rx, ry, 0, endAngle, startAngle, true);
9274
9294
  } else {
9275
9295
  if (innerRadius < 1) {
@@ -9286,7 +9306,7 @@ let Ellipse = class Ellipse extends UI {
9286
9306
  ellipse(path, rx, ry, rx, ry);
9287
9307
  }
9288
9308
  }
9289
- closePath$2(path);
9309
+ if (!open) closePath$2(path);
9290
9310
  if (Platform.ellipseToCurve) this.__.path = this.getPath(true);
9291
9311
  }
9292
9312
  };
@@ -11151,6 +11171,7 @@ ui$5.__updateHitCanvas = function() {
11151
11171
  ImageManager.patternLocked = true;
11152
11172
  this.__renderShape(h, {
11153
11173
  matrix: matrix$2.setWith(this.__world).scaleWith(1 / scale).invertWith().translate(-x, -y),
11174
+ snapshot: true,
11154
11175
  ignoreFill: !isHitPixelFill,
11155
11176
  ignoreStroke: !isHitPixelStroke
11156
11177
  });
@@ -11654,7 +11675,7 @@ function image(ui, attrName, paint, boxBounds, firstUse) {
11654
11675
  ignoreRender(ui, false);
11655
11676
  onLoadError(ui, event, error);
11656
11677
  leafPaint.loadId = undefined;
11657
- }, paint.lod && image.getThumbSize());
11678
+ }, paint.lod && image.getThumbSize(paint.lod));
11658
11679
  if (ui.placeholderColor) {
11659
11680
  if (!ui.placeholderDelay) image.isPlacehold = true; else setTimeout(() => {
11660
11681
  if (!image.ready) {
@@ -11724,7 +11745,7 @@ function getPatternData(paint, box, image) {
11724
11745
  if (paint.padding) box = tempBox.set(box).shrink(paint.padding);
11725
11746
  if (paint.mode === "strench") paint.mode = "stretch";
11726
11747
  const {width: width, height: height} = image;
11727
- const {opacity: opacity, mode: mode, align: align, offset: offset, scale: scale, size: size, rotation: rotation, skew: skew, clipSize: clipSize, repeat: repeat, gap: gap, filters: filters} = paint;
11748
+ const {opacity: opacity, mode: mode, align: align, offset: offset, scale: scale, size: size, rotation: rotation, skew: skew, clipSize: clipSize, repeat: repeat, gap: gap, filters: filters, interlace: interlace} = paint;
11728
11749
  const sameBox = box.width === width && box.height === height;
11729
11750
  const data = {
11730
11751
  mode: mode
@@ -11790,6 +11811,10 @@ function getPatternData(paint, box, image) {
11790
11811
  if (opacity && opacity < 1) data.opacity = opacity;
11791
11812
  if (filters) data.filters = filters;
11792
11813
  if (repeat) data.repeat = isString(repeat) ? repeat === "x" ? "repeat-x" : "repeat-y" : "repeat";
11814
+ if (interlace) data.interlace = isNumber(interlace) || interlace.type === "percent" ? {
11815
+ type: "x",
11816
+ offset: interlace
11817
+ } : interlace;
11793
11818
  return data;
11794
11819
  }
11795
11820
 
@@ -11923,7 +11948,7 @@ function createPattern(paint, ui, canvas, renderOptions) {
11923
11948
  if (transform) copy$4(imageMatrix, transform);
11924
11949
  scale$1(imageMatrix, 1 / scaleX, 1 / scaleY);
11925
11950
  }
11926
- const imageCanvas = image.getCanvas(width, height, data.opacity, data.filters, xGap, yGap, ui.leafer && ui.leafer.config.smooth);
11951
+ const imageCanvas = image.getCanvas(width, height, data.opacity, data.filters, xGap, yGap, ui.leafer && ui.leafer.config.smooth, data.interlace);
11927
11952
  const pattern = image.getPattern(imageCanvas, data.repeat || (Platform.origin.noRepeat || "no-repeat"), imageMatrix, paint);
11928
11953
  paint.style = pattern;
11929
11954
  paint.patternId = id;
@@ -11945,8 +11970,8 @@ function getPatternFixScale(paint, imageScaleX, imageScaleY) {
11945
11970
 
11946
11971
  function checkImage(paint, drawImage, ui, canvas, renderOptions) {
11947
11972
  const {scaleX: scaleX, scaleY: scaleY} = PaintImage.getImageRenderScaleData(paint, ui, canvas, renderOptions);
11948
- const {image: image, data: data, originPaint: originPaint} = paint, {exporting: exporting} = renderOptions;
11949
- if (!data || paint.patternId === scaleX + "-" + scaleY && !exporting) {
11973
+ const {image: image, data: data, originPaint: originPaint} = paint, {exporting: exporting, snapshot: snapshot} = renderOptions;
11974
+ if (!data || paint.patternId === scaleX + "-" + scaleY && !exporting || snapshot) {
11950
11975
  return false;
11951
11976
  } else {
11952
11977
  if (drawImage) {
@@ -12620,7 +12645,7 @@ const TextMode = 2;
12620
12645
 
12621
12646
  function layoutChar(drawData, style, width, _height) {
12622
12647
  const {rows: rows} = drawData;
12623
- const {textAlign: textAlign, paraIndent: paraIndent, letterSpacing: letterSpacing} = style;
12648
+ const {textAlign: textAlign, paraIndent: paraIndent, __letterSpacing: __letterSpacing} = style;
12624
12649
  const justifyLast = width && textAlign.includes("both");
12625
12650
  const justify = justifyLast || width && textAlign.includes("justify");
12626
12651
  const justifyLetter = justify && textAlign.includes("letter");
@@ -12633,8 +12658,8 @@ function layoutChar(drawData, style, width, _height) {
12633
12658
  remainingWidth = width - row.width - indentWidth;
12634
12659
  if (justifyLetter) addLetterWidth = remainingWidth / (row.words.reduce((total, item) => total + item.data.length, 0) - 1); else addWordWidth = wordsLength > 1 ? remainingWidth / (wordsLength - 1) : 0;
12635
12660
  }
12636
- mode = letterSpacing || row.isOverflow || justifyLetter ? CharMode : addWordWidth ? WordMode : TextMode;
12637
- if (row.isOverflow && !letterSpacing) row.textMode = true;
12661
+ mode = __letterSpacing || row.isOverflow || justifyLetter ? CharMode : addWordWidth ? WordMode : TextMode;
12662
+ if (row.isOverflow && !__letterSpacing) row.textMode = true;
12638
12663
  if (mode === TextMode) {
12639
12664
  row.x += indentWidth;
12640
12665
  toTextChar$1(row);
@@ -16236,13 +16261,14 @@ leafer.initType = function(type) {
16236
16261
  };
16237
16262
 
16238
16263
  leafer.getValidMove = function(moveX, moveY, checkLimit = true) {
16239
- const {disabled: disabled} = this.app.config.move;
16264
+ const {disabled: disabled, scrollSpread: scrollSpread} = this.app.config.move;
16240
16265
  move$4.set(moveX, moveY);
16241
16266
  const scrollType = getScrollType(this);
16242
16267
  if (scrollType) {
16243
16268
  if (scrollType.includes("x")) move$4.y = 0; else if (scrollType.includes("y")) move$4.x = 0; else Math.abs(move$4.x) > Math.abs(move$4.y) ? move$4.y = 0 : move$4.x = 0;
16244
16269
  if (checkLimit && scrollType.includes("limit")) {
16245
16270
  bounds.set(this.__world).addPoint(this.zoomLayer);
16271
+ if (scrollSpread) bounds.spread(scrollSpread);
16246
16272
  DragBoundsHelper.getValidMove(bounds, this.canvas.bounds, "auto", move$4, true);
16247
16273
  if (scrollType.includes("x")) move$4.y = 0; else if (scrollType.includes("y")) move$4.x = 0;
16248
16274
  }
@@ -19946,7 +19972,13 @@ const ExportModule = {
19946
19972
  MathHelper.getScaleData(options.scale, options.size, renderBounds, scaleData);
19947
19973
  let pixelRatio = options.pixelRatio || 1;
19948
19974
  let {x: x, y: y, width: width, height: height} = new Bounds(renderBounds).scale(scaleData.scaleX, scaleData.scaleY);
19949
- if (clip) x += clip.x, y += clip.y, width = clip.width, height = clip.height;
19975
+ if (clip) {
19976
+ x += clip.x, y += clip.y, width = clip.width, height = clip.height;
19977
+ if (clip.rotation) matrix.rotateOfInner({
19978
+ x: x,
19979
+ y: y
19980
+ }, -clip.rotation);
19981
+ }
19950
19982
  const renderOptions = {
19951
19983
  exporting: true,
19952
19984
  matrix: matrix.scale(1 / scaleData.scaleX, 1 / scaleData.scaleY).invert().translate(-x, -y).withScale(1 / scaleX * scaleData.scaleX, 1 / scaleY * scaleData.scaleY)
@@ -20135,4 +20167,4 @@ Plugin.add("bright");
20135
20167
 
20136
20168
  UI.addAttr("bright", false, dimType);
20137
20169
 
20138
- export { AlignHelper, Animate, AnimateEasing, AnimateEvent, AnimateList, Answer, App, AroundHelper, Arrow, ArrowData, AutoBounds, BezierHelper, Bounds, BoundsEvent, BoundsHelper, Box, BoxData, Branch, BranchHelper, BranchRender, Canvas, CanvasData, CanvasManager, ChildEvent, ColorConvert, Creator, Cursor, DataHelper, Debug, Direction4, Direction9, DragBoundsHelper, DragEvent, Dragger, DropEvent, EditBox, EditDataHelper, EditPoint, EditSelect, EditSelectHelper, EditTool, EditToolCreator, Editor, EditorEvent, EditorGroupEvent, EditorHelper, EditorMoveEvent, EditorRotateEvent, EditorScaleEvent, EditorSkewEvent, Effect, Ellipse, EllipseData, EllipseHelper, Event, EventCreator, Eventer, Export, FileHelper, Filter, Finder, Flow, FourNumberHelper, Frame, FrameData, Group, GroupData, HTMLText, HTMLTextData, HighBezierHelper, HighCurveHelper, HitCanvasManager, Image, ImageData, ImageEvent, ImageManager, IncrementId, InnerEditor, InnerEditorEvent, InteractionBase, InteractionHelper, KeyEvent, Keyboard, LayoutEvent, Layouter, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafLayout, LeafLevelList, LeafList, LeafMatrix, LeafRender, Leafer, LeaferCanvas, LeaferCanvasBase, LeaferData, LeaferEvent, LeaferImage, LeaferTypeCreator, Line, LineData, LineEditTool, MathHelper, Matrix, MatrixHelper, MoveEvent, MultiTouchHelper, MyDragEvent, MyImage, MyPointerEvent, MyTouchEvent, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathArrowModule, PathBounds, PathCommandDataHelper, PathCommandMap, PathCommandNodeHelper, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathMatrixHelper, PathNodeHandleType, PathNumberCommandLengthMap, PathNumberCommandMap, PathScaler, Pen, PenData, Picker, Platform, Plugin, Point, PointHelper, PointerButton, PointerEvent, Polygon, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, Resource, Robot, RobotData, RotateEvent, Run, ScrollBar, SelectArea, Selector, Star, StarData, State, StringNumberMap, Stroker, SwipeEvent, TaskItem, TaskProcessor, Text, TextConvert, TextData, TextEditor, TouchEvent, TransformTool, Transformer, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIEvent, UIRender, UnitConvert, WaitHelper, WatchEvent, Watcher, WheelEventHelper, ZoomEvent, addViewport, addViewportConfig, affectRenderBoundsType, affectStrokeBoundsType, arrowType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, createAttr, createDescriptor, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, dimType, doBoundsType, doStrokeType, effectType, emptyData, eraserType, extraPropertyEventMap, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, isArray, isData, isEmptyData, isFinite$1 as isFinite, isNull, isNumber, isObject, isString, isUndefined, layoutProcessor, leaferTransformAttrMap, maskType, motionPathType, naturalBoundsType, opacityType, path, pathInputType, pathType, pen, positionType, registerEditTool, registerInnerEditor, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleResize, scaleResizeFontSize, scaleResizeGroup, scaleResizePath, scaleResizePoints, scaleType, scrollType, sortType, stateStyleType, stateType, strokeType, surfaceType, tempBounds$2 as tempBounds, tempMatrix$2 as tempMatrix, tempPoint$4 as tempPoint, tryToNumber, useCanvas, useModule, version, visibleType, zoomLayerType };
20170
+ export { AlignHelper, Animate, AnimateEasing, AnimateEvent, AnimateList, Answer, App, AroundHelper, Arrow, ArrowData, AutoBounds, BezierHelper, Bounds, BoundsEvent, BoundsHelper, Box, BoxData, Branch, BranchHelper, BranchRender, Canvas, CanvasData, CanvasManager, ChildEvent, ColorConvert, Creator, Cursor, DataHelper, Debug, Direction4, Direction9, DragBoundsHelper, DragEvent, Dragger, DropEvent, EditBox, EditDataHelper, EditPoint, EditSelect, EditSelectHelper, EditTool, EditToolCreator, Editor, EditorEvent, EditorGroupEvent, EditorHelper, EditorMoveEvent, EditorRotateEvent, EditorScaleEvent, EditorSkewEvent, Effect, Ellipse, EllipseData, EllipseHelper, Event, EventCreator, Eventer, Export, FileHelper, Filter, Finder, Flow, FourNumberHelper, Frame, FrameData, Group, GroupData, HTMLText, HTMLTextData, HighBezierHelper, HighCurveHelper, HitCanvasManager, Image, ImageData, ImageEvent, ImageManager, IncrementId, InnerEditor, InnerEditorEvent, InteractionBase, InteractionHelper, KeyEvent, Keyboard, LayoutEvent, Layouter, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafLayout, LeafLevelList, LeafList, LeafMatrix, LeafRender, Leafer, LeaferCanvas, LeaferCanvasBase, LeaferData, LeaferEvent, LeaferImage, LeaferTypeCreator, Line, LineData, LineEditTool, MathHelper, Matrix, MatrixHelper, MoveEvent, MultiTouchHelper, MyDragEvent, MyImage, MyPointerEvent, MyTouchEvent, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathArrowModule, PathBounds, PathCommandDataHelper, PathCommandMap, PathCommandNodeHelper, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathMatrixHelper, PathNodeHandleType, PathNumberCommandLengthMap, PathNumberCommandMap, PathScaler, Pen, PenData, Picker, Platform, Plugin, Point, PointHelper, PointerButton, PointerEvent, Polygon, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, Resource, Robot, RobotData, RotateEvent, Run, ScrollBar, SelectArea, Selector, Star, StarData, State, StringNumberMap, Stroker, SwipeEvent, TaskItem, TaskProcessor, Text, TextConvert, TextData, TextEditor, TouchEvent, TransformTool, Transformer, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIEvent, UIRender, UnitConvert, UnitConvertHelper, WaitHelper, WatchEvent, Watcher, WheelEventHelper, ZoomEvent, addViewport, addViewportConfig, affectRenderBoundsType, affectStrokeBoundsType, arrowType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, createAttr, createDescriptor, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, dimType, doBoundsType, doStrokeType, effectType, emptyData, eraserType, extraPropertyEventMap, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, isArray, isData, isEmptyData, isFinite$1 as isFinite, isNull, isNumber, isObject, isString, isUndefined, layoutProcessor, leaferTransformAttrMap, maskType, motionPathType, naturalBoundsType, opacityType, path, pathInputType, pathType, pen, positionType, registerEditTool, registerInnerEditor, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleResize, scaleResizeFontSize, scaleResizeGroup, scaleResizePath, scaleResizePoints, scaleType, scrollType, sortType, stateStyleType, stateType, strokeType, surfaceType, tempBounds$2 as tempBounds, tempMatrix$2 as tempMatrix, tempPoint$4 as tempPoint, tryToNumber, useCanvas, useModule, version, visibleType, zoomLayerType };