@leafer-ui/hit 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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer-ui/hit",
3
- "version": "1.12.0",
3
+ "version": "1.12.1",
4
4
  "description": "@leafer-ui/hit",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -22,11 +22,11 @@
22
22
  "leaferjs"
23
23
  ],
24
24
  "dependencies": {
25
- "@leafer/core": "1.12.0",
26
- "@leafer-ui/draw": "1.12.0"
25
+ "@leafer/core": "1.12.1",
26
+ "@leafer-ui/draw": "1.12.1"
27
27
  },
28
28
  "devDependencies": {
29
- "@leafer/interface": "1.12.0",
30
- "@leafer-ui/interface": "1.12.0"
29
+ "@leafer/interface": "1.12.1",
30
+ "@leafer-ui/interface": "1.12.1"
31
31
  }
32
32
  }
package/src/LeafHit.ts CHANGED
@@ -20,7 +20,7 @@ leaf.hit = function (worldPoint: IPointData, hitRadius: number = 0): boolean {
20
20
  return this.isBranch ? Platform.getSelector(this).hitPoint({ ...worldRadiusPoint }, hitRadius, { target: this as unknown as IBranch }) : this.__hitWorld(worldRadiusPoint)
21
21
  }
22
22
 
23
- leaf.__hitWorld = function (point: IRadiusPointData): boolean {
23
+ leaf.__hitWorld = function (point: IRadiusPointData, forceHitFill?: boolean): boolean {
24
24
  const data = this.__
25
25
  if (!data.hitSelf) return false
26
26
 
@@ -44,7 +44,7 @@ leaf.__hitWorld = function (point: IRadiusPointData): boolean {
44
44
  if (!layout.boundsChanged) layout.hitCanvasChanged = false
45
45
  }
46
46
 
47
- return this.__hit(inner)
47
+ return this.__hit(inner, forceHitFill)
48
48
  }
49
49
 
50
50
  leaf.__hitFill = function (inner: IRadiusPointData): boolean { const h = this.__hitCanvas; return h && h.hitFill(inner, this.__.windingRule) }
package/src/UIHit.ts CHANGED
@@ -45,7 +45,7 @@ ui.__updateHitCanvas = function (): void {
45
45
 
46
46
  }
47
47
 
48
- ui.__hit = function (inner: IRadiusPointData): boolean {
48
+ ui.__hit = function (inner: IRadiusPointData, forceHitFill?: boolean): boolean {
49
49
 
50
50
  if (this.__box && this.__box.__hit(inner)) return true
51
51
 
@@ -55,7 +55,7 @@ ui.__hit = function (inner: IRadiusPointData): boolean {
55
55
 
56
56
  // hit path
57
57
  const { hitFill } = data
58
- const needHitFillPath = ((data.fill || data.__isCanvas) && (hitFill === 'path' || (hitFill === 'pixel' && !(data.__isAlphaPixelFill || data.__isCanvas)))) || hitFill === 'all'
58
+ const needHitFillPath = ((data.fill || data.__isCanvas) && (hitFill === 'path' || (hitFill === 'pixel' && !(data.__isAlphaPixelFill || data.__isCanvas)))) || hitFill === 'all' || forceHitFill
59
59
  if (needHitFillPath && this.__hitFill(inner)) return true
60
60
 
61
61
  const { hitStroke, __maxStrokeWidth: strokeWidth } = data