@leafer-draw/worker 2.0.3 → 2.0.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.
@@ -5620,7 +5620,7 @@ class BoundsEvent extends Event {
5620
5620
  }
5621
5621
  }
5622
5622
  static emitWorld(leaf) {
5623
- if (leaf.leaferIsReady) leaf.emit(WORLD, this);
5623
+ if (leaf.leaferIsReady) leaf.emit(WORLD, leaf);
5624
5624
  }
5625
5625
  }
5626
5626
 
@@ -6581,14 +6581,16 @@ let Leaf = class Leaf {
6581
6581
  relative.innerToWorld(world, to, distance);
6582
6582
  world = to ? to : world;
6583
6583
  }
6584
- toInnerPoint(this.scrollWorldTransform, world, to, distance);
6584
+ toInnerPoint(this.worldTransform, world, to, distance);
6585
6585
  }
6586
6586
  innerToWorld(inner, to, distance, relative) {
6587
- toOuterPoint(this.scrollWorldTransform, inner, to, distance);
6587
+ toOuterPoint(this.worldTransform, inner, to, distance);
6588
6588
  if (relative) relative.worldToInner(to ? to : inner, null, distance);
6589
6589
  }
6590
6590
  getBoxPoint(world, relative, distance, change) {
6591
- return this.getBoxPointByInner(this.getInnerPoint(world, relative, distance, change), null, null, true);
6591
+ const inner = this.getInnerPoint(world, relative, distance, change);
6592
+ if (distance) return inner;
6593
+ return this.getBoxPointByInner(inner, null, null, true);
6592
6594
  }
6593
6595
  getBoxPointByInner(inner, _relative, _distance, change) {
6594
6596
  const point = change ? inner : Object.assign({}, inner), {x: x, y: y} = this.boxBounds;
@@ -7051,7 +7053,7 @@ class LeafLevelList {
7051
7053
  }
7052
7054
  }
7053
7055
 
7054
- const version = "2.0.3";
7056
+ const version = "2.0.4";
7055
7057
 
7056
7058
  class LeaferCanvas extends LeaferCanvasBase {
7057
7059
  get allowBackgroundColor() {
@@ -8039,7 +8041,11 @@ class EllipseData extends UIData {
8039
8041
 
8040
8042
  class PolygonData extends LineData {}
8041
8043
 
8042
- class StarData extends UIData {}
8044
+ class StarData extends UIData {
8045
+ get __boxStroke() {
8046
+ return !this.__pathInputed;
8047
+ }
8048
+ }
8043
8049
 
8044
8050
  class PathData extends UIData {
8045
8051
  get __pathInputed() {
@@ -9051,6 +9057,9 @@ let Box = class Box extends Group {
9051
9057
  get isBranchLeaf() {
9052
9058
  return true;
9053
9059
  }
9060
+ get __useSelfBox() {
9061
+ return this.pathInputed;
9062
+ }
9054
9063
  constructor(data) {
9055
9064
  super(data);
9056
9065
  this.__layout.renderChanged || this.__layout.renderChange();
@@ -9066,7 +9075,7 @@ let Box = class Box extends Group {
9066
9075
  }
9067
9076
  __updateRectBoxBounds() {}
9068
9077
  __updateBoxBounds(_secondLayout) {
9069
- if (this.children.length && !this.pathInputed) {
9078
+ if (this.children.length && !this.__useSelfBox) {
9070
9079
  const data = this.__;
9071
9080
  if (data.__autoSide) {
9072
9081
  if (data.__hasSurface) this.__extraUpdate();
@@ -10376,7 +10385,7 @@ function checkImage(paint, drawImage, ui, canvas, renderOptions) {
10376
10385
  if (drawImage) {
10377
10386
  if (data.repeat) {
10378
10387
  drawImage = false;
10379
- } else if (!(originPaint.changeful || paint.film || Platform.name === "miniapp" && ResizeEvent.isResizing(ui) || exporting)) {
10388
+ } else if (!(originPaint.changeful || paint.film || Platform.name === "miniapp" || exporting)) {
10380
10389
  drawImage = Platform.image.isLarge(image, scaleX, scaleY) || image.width * scaleX > 8096 || image.height * scaleY > 8096;
10381
10390
  }
10382
10391
  }
@@ -10929,7 +10938,7 @@ function createRows(drawData, content, style) {
10929
10938
  }, row = {
10930
10939
  words: []
10931
10940
  };
10932
- if (__letterSpacing) content = [ ...content ];
10941
+ content = [ ...content ];
10933
10942
  for (let i = 0, len = content.length; i < len; i++) {
10934
10943
  char = content[i];
10935
10944
  if (char === "\n") {