leafer-game 2.2.4 → 2.2.5

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.
package/dist/web.js CHANGED
@@ -4480,7 +4480,7 @@ var LeaferUI = function(exports) {
4480
4480
  if (!excludeNames.includes(name) && (!exclude || !exclude.includes(name))) {
4481
4481
  if (module.prototype) {
4482
4482
  const d = getDescriptor(module.prototype, name);
4483
- if (d.writable) target.prototype[name] = module.prototype[name];
4483
+ if (d) Object.defineProperty(target.prototype, name, d);
4484
4484
  } else {
4485
4485
  target.prototype[name] = module[name];
4486
4486
  }
@@ -6606,7 +6606,7 @@ var LeaferUI = function(exports) {
6606
6606
  this.levelMap = null;
6607
6607
  }
6608
6608
  }
6609
- const version = "2.2.4";
6609
+ const version = "2.2.5";
6610
6610
  const debug$5 = Debug.get("LeaferCanvas");
6611
6611
  class LeaferCanvas extends LeaferCanvasBase {
6612
6612
  set zIndex(zIndex) {
@@ -7582,7 +7582,7 @@ var LeaferUI = function(exports) {
7582
7582
  if (child.__hitWorld(point, onlyHitMask && child.mask === "path" ? true : undefined)) {
7583
7583
  const {parent: parent, mask: mask} = child;
7584
7584
  if (parent && parent.__hasMask && mask && !(mask === "clipping" || mask === "clipping-path")) {
7585
- if (!parent.children.some(item => !item.mask && item.__hitWorld(point))) return;
7585
+ if (!parent.children.some(item => !item.mask && this.isHitLeaf(item, point))) return;
7586
7586
  }
7587
7587
  const leaf = proxy || child, {hitThrough: hitThrough} = child, {findList: findList} = this;
7588
7588
  if (hitThrough) {
@@ -7592,6 +7592,15 @@ var LeaferUI = function(exports) {
7592
7592
  findList.add(leaf);
7593
7593
  }
7594
7594
  }
7595
+ isHitLeaf(leaf, point) {
7596
+ if (leaf.isBranch) {
7597
+ const {findList: findList} = this, old = findList.length;
7598
+ this.eachFind([ leaf ], false);
7599
+ const count = findList.length - old;
7600
+ for (let i = 0; i < count; i++) findList.remove(findList.indexAt(findList.length - 1));
7601
+ return !!count;
7602
+ } else return leaf.__hitWorld(point);
7603
+ }
7595
7604
  clear() {
7596
7605
  this.point = null;
7597
7606
  this.findList = null;