@leafer-ui/interaction 1.5.3 → 1.6.0
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 +6 -6
- package/src/Interaction.ts +5 -3
- package/src/config.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer-ui/interaction",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "@leafer-ui/interaction",
|
|
5
5
|
"author": "Chao (Leafer) Wan",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,12 +22,12 @@
|
|
|
22
22
|
"leaferjs"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@leafer/core": "1.
|
|
26
|
-
"@leafer-ui/draw": "1.
|
|
27
|
-
"@leafer-ui/event": "1.
|
|
25
|
+
"@leafer/core": "1.6.0",
|
|
26
|
+
"@leafer-ui/draw": "1.6.0",
|
|
27
|
+
"@leafer-ui/event": "1.6.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@leafer/interface": "1.
|
|
31
|
-
"@leafer-ui/interface": "1.
|
|
30
|
+
"@leafer/interface": "1.6.0",
|
|
31
|
+
"@leafer-ui/interface": "1.6.0"
|
|
32
32
|
}
|
|
33
33
|
}
|
package/src/Interaction.ts
CHANGED
|
@@ -96,8 +96,8 @@ export class InteractionBase implements IInteraction {
|
|
|
96
96
|
public pointerDown(data?: IPointerEvent, useDefaultPath?: boolean): void {
|
|
97
97
|
if (!data) data = this.hoverData
|
|
98
98
|
if (!data) return
|
|
99
|
-
PointerButton.defaultLeft(data)
|
|
100
99
|
|
|
100
|
+
PointerButton.defaultLeft(data)
|
|
101
101
|
this.updateDownData(data)
|
|
102
102
|
this.checkPath(data, useDefaultPath)
|
|
103
103
|
|
|
@@ -137,7 +137,7 @@ export class InteractionBase implements IInteraction {
|
|
|
137
137
|
if (this.downData) {
|
|
138
138
|
const canDrag = PointHelper.getDistance(this.downData, data) > this.p.dragDistance
|
|
139
139
|
if (canDrag) {
|
|
140
|
-
if (this.waitTap) this.pointerWaitCancel()
|
|
140
|
+
if (this.waitTap || this.longPressTimer) this.pointerWaitCancel()
|
|
141
141
|
this.waitRightTap = false
|
|
142
142
|
}
|
|
143
143
|
|
|
@@ -454,7 +454,9 @@ export class InteractionBase implements IInteraction {
|
|
|
454
454
|
|
|
455
455
|
public getLocal(clientPoint: IClientPointData, updateClient?: boolean): IPointData {
|
|
456
456
|
const clientBounds = this.canvas.getClientBounds(updateClient)
|
|
457
|
-
|
|
457
|
+
const point = { x: clientPoint.clientX - clientBounds.x, y: clientPoint.clientY - clientBounds.y }
|
|
458
|
+
if (this.p.snap) PointHelper.round(point)
|
|
459
|
+
return point
|
|
458
460
|
}
|
|
459
461
|
|
|
460
462
|
|