@leafer-ui/hit 1.6.2 → 1.6.3
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 +5 -5
- package/src/UIHit.ts +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer-ui/hit",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.3",
|
|
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.6.
|
|
26
|
-
"@leafer-ui/draw": "1.6.
|
|
25
|
+
"@leafer/core": "1.6.3",
|
|
26
|
+
"@leafer-ui/draw": "1.6.3"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@leafer/interface": "1.6.
|
|
30
|
-
"@leafer-ui/interface": "1.6.
|
|
29
|
+
"@leafer/interface": "1.6.3",
|
|
30
|
+
"@leafer-ui/interface": "1.6.3"
|
|
31
31
|
}
|
|
32
32
|
}
|
package/src/UIHit.ts
CHANGED
|
@@ -11,8 +11,8 @@ ui.__updateHitCanvas = function (): void {
|
|
|
11
11
|
if (this.__box) this.__box.__updateHitCanvas()
|
|
12
12
|
|
|
13
13
|
const data = this.__, { hitCanvasManager } = this.leafer || this.parent.leafer // 兼容 boxStyle
|
|
14
|
-
const isHitPixelFill = (data.
|
|
15
|
-
const isHitPixelStroke = data.
|
|
14
|
+
const isHitPixelFill = (data.__isAlphaPixelFill || data.__isCanvas) && data.hitFill === 'pixel'
|
|
15
|
+
const isHitPixelStroke = data.__isAlphaPixelStroke && data.hitStroke === 'pixel'
|
|
16
16
|
const isHitPixel = isHitPixelFill || isHitPixelStroke
|
|
17
17
|
|
|
18
18
|
if (!this.__hitCanvas) this.__hitCanvas = isHitPixel ? hitCanvasManager.getPixelType(this, { contextSettings: { willReadFrequently: true } }) : hitCanvasManager.getPathType(this)
|
|
@@ -52,11 +52,11 @@ ui.__hit = function (inner: IRadiusPointData): boolean {
|
|
|
52
52
|
|
|
53
53
|
// hit path
|
|
54
54
|
const { hitFill } = data
|
|
55
|
-
const needHitFillPath = ((data.fill || data.__isCanvas) && (hitFill === 'path' || (hitFill === 'pixel' && !(data.
|
|
55
|
+
const needHitFillPath = ((data.fill || data.__isCanvas) && (hitFill === 'path' || (hitFill === 'pixel' && !(data.__isAlphaPixelFill || data.__isCanvas)))) || hitFill === 'all'
|
|
56
56
|
if (needHitFillPath && this.__hitFill(inner)) return true
|
|
57
57
|
|
|
58
58
|
const { hitStroke, __strokeWidth } = data
|
|
59
|
-
const needHitStrokePath = (data.stroke && (hitStroke === 'path' || (hitStroke === 'pixel' && !data.
|
|
59
|
+
const needHitStrokePath = (data.stroke && (hitStroke === 'path' || (hitStroke === 'pixel' && !data.__isAlphaPixelStroke))) || hitStroke === 'all'
|
|
60
60
|
if (!needHitFillPath && !needHitStrokePath) return false
|
|
61
61
|
|
|
62
62
|
const radiusWidth = inner.radiusX * 2
|