@leafer-draw/miniapp 2.1.8 → 2.1.10

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.
@@ -1256,6 +1256,7 @@ const BoundsHelper = {
1256
1256
  },
1257
1257
  copyAndSpread(t, bounds, spread, isShrink, side) {
1258
1258
  const {x: x, y: y, width: width, height: height} = bounds;
1259
+ if (!spread) spread = 0;
1259
1260
  if (isArray(spread)) {
1260
1261
  const four = fourNumber(spread);
1261
1262
  isShrink ? B.set(t, x + four[3], y + four[0], width - four[1] - four[3], height - four[2] - four[0]) : B.set(t, x - four[3], y - four[0], width + four[1] + four[3], height + four[2] + four[0]);
@@ -6984,7 +6985,7 @@ class LeafLevelList {
6984
6985
  }
6985
6986
  }
6986
6987
 
6987
- const version = "2.1.8";
6988
+ const version = "2.1.10";
6988
6989
 
6989
6990
  class LeaferCanvas extends LeaferCanvasBase {
6990
6991
  get allowBackgroundColor() {
@@ -7300,7 +7301,10 @@ class Watcher {
7300
7301
  if (this.running) this.target.emit(RenderEvent.REQUEST);
7301
7302
  }
7302
7303
  __onAttrChange(event) {
7303
- if (this.config.usePartLayout) this.__updatedList.add(event.target);
7304
+ this.add(event.target);
7305
+ }
7306
+ add(leaf) {
7307
+ if (this.config.usePartLayout) this.__updatedList.add(leaf);
7304
7308
  this.update();
7305
7309
  }
7306
7310
  __onChildEvent(event) {
@@ -8139,11 +8143,7 @@ class PolygonData extends UIData {
8139
8143
  }
8140
8144
  }
8141
8145
 
8142
- class StarData extends UIData {
8143
- get __boxStroke() {
8144
- return !this.__pathInputed;
8145
- }
8146
- }
8146
+ class StarData extends UIData {}
8147
8147
 
8148
8148
  class PathData extends UIData {
8149
8149
  get __pathInputed() {
@@ -10436,13 +10436,9 @@ function createPattern(paint, ui, canvas, renderOptions) {
10436
10436
  if (fixScale) scaleX *= fixScale, scaleY *= fixScale;
10437
10437
  width *= scaleX;
10438
10438
  height *= scaleY;
10439
- if (gap) {
10439
+ if (gap && !brush) {
10440
10440
  xGap = gap.x * scaleX / abs$1(data.scaleX || 1);
10441
10441
  yGap = gap.y * scaleY / abs$1(data.scaleY || 1);
10442
- if (brush) {
10443
- const brushScale = PaintImage.getBrushScale(paint, ui);
10444
- xGap /= brushScale, yGap /= brushScale;
10445
- }
10446
10442
  }
10447
10443
  if (transform || scaleX !== 1 || scaleY !== 1) {
10448
10444
  scaleX *= getFloorScale(width + (xGap || 0));