@leafer/worker 1.12.0 → 1.12.1

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.
@@ -4951,10 +4951,53 @@ const BranchHelper = {
4951
4951
  if (exclude && exclude === branch) continue;
4952
4952
  updateBounds$4(branch);
4953
4953
  }
4954
+ },
4955
+ move(branch, x, y) {
4956
+ let w;
4957
+ const {children: children} = branch;
4958
+ for (let i = 0, len = children.length; i < len; i++) {
4959
+ branch = children[i];
4960
+ w = branch.__world;
4961
+ w.e += x;
4962
+ w.f += y;
4963
+ w.x += x;
4964
+ w.y += y;
4965
+ if (branch.isBranch) move$9(branch, x, y);
4966
+ }
4967
+ },
4968
+ scale(branch, x, y, scaleX, scaleY, a, b) {
4969
+ let w;
4970
+ const {children: children} = branch;
4971
+ const changeScaleX = scaleX - 1;
4972
+ const changeScaleY = scaleY - 1;
4973
+ for (let i = 0, len = children.length; i < len; i++) {
4974
+ branch = children[i];
4975
+ w = branch.__world;
4976
+ w.a *= scaleX;
4977
+ w.d *= scaleY;
4978
+ if (w.b || w.c) {
4979
+ w.b *= scaleX;
4980
+ w.c *= scaleY;
4981
+ }
4982
+ if (w.e === w.x && w.f === w.y) {
4983
+ w.x = w.e += (w.e - a) * changeScaleX + x;
4984
+ w.y = w.f += (w.f - b) * changeScaleY + y;
4985
+ } else {
4986
+ w.e += (w.e - a) * changeScaleX + x;
4987
+ w.f += (w.f - b) * changeScaleY + y;
4988
+ w.x += (w.x - a) * changeScaleX + x;
4989
+ w.y += (w.y - b) * changeScaleY + y;
4990
+ }
4991
+ w.width *= scaleX;
4992
+ w.height *= scaleY;
4993
+ w.scaleX *= scaleX;
4994
+ w.scaleY *= scaleY;
4995
+ if (branch.isBranch) scale$2(branch, x, y, scaleX, scaleY, a, b);
4996
+ }
4954
4997
  }
4955
4998
  };
4956
4999
 
4957
- const {pushAllChildBranch: pushAllChildBranch$1, pushAllBranchStack: pushAllBranchStack, updateBoundsByBranchStack: updateBoundsByBranchStack} = BranchHelper;
5000
+ const {pushAllChildBranch: pushAllChildBranch$1, pushAllBranchStack: pushAllBranchStack, updateBoundsByBranchStack: updateBoundsByBranchStack, move: move$9, scale: scale$2} = BranchHelper;
4958
5001
 
4959
5002
  const WaitHelper = {
4960
5003
  run(wait) {
@@ -6518,10 +6561,10 @@ let Leaf = class Leaf {
6518
6561
  hit(_world, _hitRadius) {
6519
6562
  return true;
6520
6563
  }
6521
- __hitWorld(_point) {
6564
+ __hitWorld(_point, _forceHitFill) {
6522
6565
  return true;
6523
6566
  }
6524
- __hit(_local) {
6567
+ __hit(_local, _forceHitFill) {
6525
6568
  return true;
6526
6569
  }
6527
6570
  __hitFill(_inner) {
@@ -6880,7 +6923,7 @@ class LeafLevelList {
6880
6923
  }
6881
6924
  }
6882
6925
 
6883
- const version = "1.12.0";
6926
+ const version = "1.12.1";
6884
6927
 
6885
6928
  class LeaferCanvas extends LeaferCanvasBase {
6886
6929
  get allowBackgroundColor() {
@@ -7663,7 +7706,7 @@ class Picker {
7663
7706
  hit = child.__.hitRadius ? true : hitRadiusPoint$1(child.__world, point);
7664
7707
  if (child.isBranch) {
7665
7708
  if (hit || child.__ignoreHitWorld) {
7666
- if (child.isBranchLeaf && child.__.__clipAfterFill && !child.__hitWorld(point)) continue;
7709
+ if (child.isBranchLeaf && child.__.__clipAfterFill && !child.__hitWorld(point, true)) continue;
7667
7710
  if (child.topChildren) this.eachFind(child.topChildren, false);
7668
7711
  this.eachFind(child.children, child.__onlyHitMask);
7669
7712
  if (child.isBranchLeaf) this.hitChild(child, point);
@@ -10982,7 +11025,7 @@ leaf$1.hit = function(worldPoint, hitRadius = 0) {
10982
11025
  }) : this.__hitWorld(worldRadiusPoint);
10983
11026
  };
10984
11027
 
10985
- leaf$1.__hitWorld = function(point) {
11028
+ leaf$1.__hitWorld = function(point, forceHitFill) {
10986
11029
  const data = this.__;
10987
11030
  if (!data.hitSelf) return false;
10988
11031
  const world = this.__world, layout = this.__layout;
@@ -11000,7 +11043,7 @@ leaf$1.__hitWorld = function(point) {
11000
11043
  this.__updateHitCanvas();
11001
11044
  if (!layout.boundsChanged) layout.hitCanvasChanged = false;
11002
11045
  }
11003
- return this.__hit(inner);
11046
+ return this.__hit(inner, forceHitFill);
11004
11047
  };
11005
11048
 
11006
11049
  leaf$1.__hitFill = function(inner) {
@@ -11067,12 +11110,12 @@ ui$5.__updateHitCanvas = function() {
11067
11110
  h.setStrokeOptions(data);
11068
11111
  };
11069
11112
 
11070
- ui$5.__hit = function(inner) {
11113
+ ui$5.__hit = function(inner, forceHitFill) {
11071
11114
  if (this.__box && this.__box.__hit(inner)) return true;
11072
11115
  const data = this.__;
11073
11116
  if (data.__isHitPixel && this.__hitPixel(inner)) return true;
11074
11117
  const {hitFill: hitFill} = data;
11075
- const needHitFillPath = (data.fill || data.__isCanvas) && (hitFill === "path" || hitFill === "pixel" && !(data.__isAlphaPixelFill || data.__isCanvas)) || hitFill === "all";
11118
+ const needHitFillPath = (data.fill || data.__isCanvas) && (hitFill === "path" || hitFill === "pixel" && !(data.__isAlphaPixelFill || data.__isCanvas)) || hitFill === "all" || forceHitFill;
11076
11119
  if (needHitFillPath && this.__hitFill(inner)) return true;
11077
11120
  const {hitStroke: hitStroke, __maxStrokeWidth: strokeWidth} = data;
11078
11121
  const needHitStrokePath = data.stroke && (hitStroke === "path" || hitStroke === "pixel" && !data.__isAlphaPixelStroke) || hitStroke === "all";