@leafer-ui/interaction 1.3.2 → 1.4.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 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer-ui/interaction",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.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.4.0",
|
|
26
|
+
"@leafer-ui/draw": "1.4.0",
|
|
27
|
+
"@leafer-ui/event": "1.4.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@leafer/interface": "1.
|
|
31
|
-
"@leafer-ui/interface": "1.
|
|
30
|
+
"@leafer/interface": "1.4.0",
|
|
31
|
+
"@leafer-ui/interface": "1.4.0"
|
|
32
32
|
}
|
|
33
33
|
}
|
package/src/Interaction.ts
CHANGED
|
@@ -132,11 +132,10 @@ export class InteractionBase implements IInteraction {
|
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
public pointerMoveReal(data: IPointerEvent): void {
|
|
135
|
-
const { dragHover, dragDistance } = this.p
|
|
136
135
|
this.emit(PointerEvent.BEFORE_MOVE, data, this.defaultPath)
|
|
137
136
|
|
|
138
137
|
if (this.downData) {
|
|
139
|
-
const canDrag = PointHelper.getDistance(this.downData, data) > dragDistance
|
|
138
|
+
const canDrag = PointHelper.getDistance(this.downData, data) > this.p.dragDistance
|
|
140
139
|
if (canDrag) {
|
|
141
140
|
if (this.waitTap) this.pointerWaitCancel()
|
|
142
141
|
this.waitRightTap = false
|
|
@@ -151,9 +150,9 @@ export class InteractionBase implements IInteraction {
|
|
|
151
150
|
|
|
152
151
|
this.emit(PointerEvent.MOVE, data)
|
|
153
152
|
|
|
154
|
-
|
|
153
|
+
this.pointerHover(data)
|
|
155
154
|
|
|
156
|
-
if (this.
|
|
155
|
+
if (this.dragging) {
|
|
157
156
|
this.dragger.dragOverOrOut(data)
|
|
158
157
|
this.dragger.dragEnterOrLeave(data)
|
|
159
158
|
}
|
|
@@ -266,7 +265,8 @@ export class InteractionBase implements IInteraction {
|
|
|
266
265
|
|
|
267
266
|
// helper
|
|
268
267
|
protected pointerHover(data: IPointerEvent): void {
|
|
269
|
-
if (this.canHover) {
|
|
268
|
+
if (this.canHover && !(this.dragging && !this.p.dragHover)) {
|
|
269
|
+
data.path || (data.path = new LeafList()) // 离开画布的情况
|
|
270
270
|
this.pointerOverOrOut(data)
|
|
271
271
|
this.pointerEnterOrLeave(data)
|
|
272
272
|
}
|