@leafer/selector 1.0.0-alpha.10 → 1.0.0-alpha.21

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.
Files changed (2) hide show
  1. package/package.json +5 -5
  2. package/src/PathFinder.ts +16 -19
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer/selector",
3
- "version": "1.0.0-alpha.10",
3
+ "version": "1.0.0-alpha.21",
4
4
  "description": "@leafer/selector",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -19,11 +19,11 @@
19
19
  "leaferjs"
20
20
  ],
21
21
  "dependencies": {
22
- "@leafer/event": "1.0.0-alpha.10",
23
- "@leafer/math": "1.0.0-alpha.10",
24
- "@leafer/list": "1.0.0-alpha.10"
22
+ "@leafer/event": "1.0.0-alpha.21",
23
+ "@leafer/math": "1.0.0-alpha.21",
24
+ "@leafer/list": "1.0.0-alpha.21"
25
25
  },
26
26
  "devDependencies": {
27
- "@leafer/interface": "1.0.0-alpha.10"
27
+ "@leafer/interface": "1.0.0-alpha.21"
28
28
  }
29
29
  }
package/src/PathFinder.ts CHANGED
@@ -69,17 +69,14 @@ export class PathFinder {
69
69
  const { point } = this, len = children.length
70
70
  for (let i = len - 1; i > -1; i--) {
71
71
  child = children[i]
72
- if (child.__interactionOff) continue
72
+ if (child.__.hittable) {
73
+ if (hitRadiusPoint(child.__world, point)) {
74
+ if (child.__isBranch && child.__.hitChildren) this.eachThroughFind(child.children)
73
75
 
74
- if (hitRadiusPoint(child.__world, point)) {
75
- if (child.__isBranch) {
76
- child.__childrenInteractionOff || this.eachThroughFind(child.children)
76
+ if (this.exclude && this.exclude.has(child)) continue
77
+ if (child.__hitWorld(point)) this.throughPath.push(child)
77
78
  }
78
-
79
- if (this.exclude && this.exclude.has(child)) continue
80
- if (child.__hitWorld(point)) this.throughPath.push(child)
81
79
  }
82
-
83
80
  }
84
81
  }
85
82
 
@@ -88,23 +85,23 @@ export class PathFinder {
88
85
  const { point } = this, len = children.length
89
86
  for (let i = len - 1; i > -1; i--) {
90
87
  child = children[i]
91
- if (child.__interactionOff) continue
88
+ if (child.__.hittable) {
89
+ if (hitRadiusPoint(child.__world, point)) {
90
+ if (child.__isBranch) {
92
91
 
93
- if (hitRadiusPoint(child.__world, point)) {
94
- if (child.__isBranch) {
92
+ if (child.__.hitChildren) this.eachFind(child.children)
95
93
 
96
- child.__childrenInteractionOff || this.eachFind(child.children)
94
+ if (child.__isBranchLeaf) { // 填充了背景色的Group, 如画板/Frame元素
95
+ if (!this.isStop) this.hitChild(child, point)
96
+ }
97
97
 
98
- if (child.__isBranchLeaf) { // 填充了背景色的Group, 如画板/Frame元素
99
- if (!this.isStop) this.hitChild(child, point)
98
+ } else {
99
+ this.hitChild(child, point)
100
100
  }
101
-
102
- } else {
103
- this.hitChild(child, point)
104
101
  }
105
- }
106
102
 
107
- if (this.isStop) break
103
+ if (this.isStop) break
104
+ }
108
105
  }
109
106
  }
110
107