leafer-ui 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$3(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$3(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$1(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$3, scale: scale$1} = 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
  const debug$5 = Debug.get("LeaferCanvas");
6886
6929
 
@@ -7869,7 +7912,7 @@ class Picker {
7869
7912
  hit = child.__.hitRadius ? true : hitRadiusPoint$1(child.__world, point);
7870
7913
  if (child.isBranch) {
7871
7914
  if (hit || child.__ignoreHitWorld) {
7872
- if (child.isBranchLeaf && child.__.__clipAfterFill && !child.__hitWorld(point)) continue;
7915
+ if (child.isBranchLeaf && child.__.__clipAfterFill && !child.__hitWorld(point, true)) continue;
7873
7916
  if (child.topChildren) this.eachFind(child.topChildren, false);
7874
7917
  this.eachFind(child.children, child.__onlyHitMask);
7875
7918
  if (child.isBranchLeaf) this.hitChild(child, point);
@@ -11188,7 +11231,7 @@ leaf.hit = function(worldPoint, hitRadius = 0) {
11188
11231
  }) : this.__hitWorld(worldRadiusPoint);
11189
11232
  };
11190
11233
 
11191
- leaf.__hitWorld = function(point) {
11234
+ leaf.__hitWorld = function(point, forceHitFill) {
11192
11235
  const data = this.__;
11193
11236
  if (!data.hitSelf) return false;
11194
11237
  const world = this.__world, layout = this.__layout;
@@ -11206,7 +11249,7 @@ leaf.__hitWorld = function(point) {
11206
11249
  this.__updateHitCanvas();
11207
11250
  if (!layout.boundsChanged) layout.hitCanvasChanged = false;
11208
11251
  }
11209
- return this.__hit(inner);
11252
+ return this.__hit(inner, forceHitFill);
11210
11253
  };
11211
11254
 
11212
11255
  leaf.__hitFill = function(inner) {
@@ -11273,12 +11316,12 @@ ui$1.__updateHitCanvas = function() {
11273
11316
  h.setStrokeOptions(data);
11274
11317
  };
11275
11318
 
11276
- ui$1.__hit = function(inner) {
11319
+ ui$1.__hit = function(inner, forceHitFill) {
11277
11320
  if (this.__box && this.__box.__hit(inner)) return true;
11278
11321
  const data = this.__;
11279
11322
  if (data.__isHitPixel && this.__hitPixel(inner)) return true;
11280
11323
  const {hitFill: hitFill} = data;
11281
- const needHitFillPath = (data.fill || data.__isCanvas) && (hitFill === "path" || hitFill === "pixel" && !(data.__isAlphaPixelFill || data.__isCanvas)) || hitFill === "all";
11324
+ const needHitFillPath = (data.fill || data.__isCanvas) && (hitFill === "path" || hitFill === "pixel" && !(data.__isAlphaPixelFill || data.__isCanvas)) || hitFill === "all" || forceHitFill;
11282
11325
  if (needHitFillPath && this.__hitFill(inner)) return true;
11283
11326
  const {hitStroke: hitStroke, __maxStrokeWidth: strokeWidth} = data;
11284
11327
  const needHitStrokePath = data.stroke && (hitStroke === "path" || hitStroke === "pixel" && !data.__isAlphaPixelStroke) || hitStroke === "all";