@leafer-ui/hit 1.12.1 → 1.12.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.
Files changed (2) hide show
  1. package/package.json +5 -5
  2. package/src/LeafHit.ts +4 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer-ui/hit",
3
- "version": "1.12.1",
3
+ "version": "1.12.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.12.1",
26
- "@leafer-ui/draw": "1.12.1"
25
+ "@leafer/core": "1.12.3",
26
+ "@leafer-ui/draw": "1.12.3"
27
27
  },
28
28
  "devDependencies": {
29
- "@leafer/interface": "1.12.1",
30
- "@leafer-ui/interface": "1.12.1"
29
+ "@leafer/interface": "1.12.3",
30
+ "@leafer-ui/interface": "1.12.3"
31
31
  }
32
32
  }
package/src/LeafHit.ts CHANGED
@@ -2,7 +2,7 @@ import { IRadiusPointData, ILeaferCanvas, IPointData, IBranch } from '@leafer/in
2
2
  import { Leaf, PointHelper, BoundsHelper, Platform } from '@leafer/core'
3
3
 
4
4
 
5
- const { toInnerRadiusPointOf, copy, setRadius } = PointHelper
5
+ const { toInnerRadiusPointOf, copyRadiusPoint } = PointHelper
6
6
  const { hitRadiusPoint, hitPoint } = BoundsHelper
7
7
  const inner = {} as IRadiusPointData, worldRadiusPoint = {} as IRadiusPointData
8
8
 
@@ -11,8 +11,7 @@ const leaf = Leaf.prototype
11
11
  leaf.hit = function (worldPoint: IPointData, hitRadius: number = 0): boolean {
12
12
  this.updateLayout()
13
13
 
14
- copy(worldRadiusPoint, worldPoint)
15
- setRadius(worldRadiusPoint, hitRadius)
14
+ copyRadiusPoint(worldRadiusPoint, worldPoint, hitRadius)
16
15
 
17
16
  const world = this.__world
18
17
  if (hitRadius ? !hitRadiusPoint(world, worldRadiusPoint) : !hitPoint(world, worldRadiusPoint)) return false
@@ -28,8 +27,8 @@ leaf.__hitWorld = function (point: IRadiusPointData, forceHitFill?: boolean): bo
28
27
  const isSmall = world.width < 10 && world.height < 10
29
28
 
30
29
  if (data.hitRadius) {
31
- copy(inner, point), point = inner
32
- setRadius(point, data.hitRadius)
30
+ copyRadiusPoint(inner, point, data.hitRadius)
31
+ point = inner
33
32
  }
34
33
 
35
34
  toInnerRadiusPointOf(point, world, inner)