@leafer-ui/interaction-web 1.0.0 → 1.0.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 +4 -4
- package/src/Interaction.ts +4 -4
- package/src/PointerEventHelper.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer-ui/interaction-web",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "@leafer-ui/interaction-web",
|
|
5
5
|
"author": "Chao (Leafer) Wan",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
"leaferjs"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@leafer/core": "1.0.
|
|
26
|
-
"@leafer-ui/core": "1.0.
|
|
25
|
+
"@leafer/core": "1.0.1",
|
|
26
|
+
"@leafer-ui/core": "1.0.1"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@leafer/interface": "1.0.
|
|
29
|
+
"@leafer/interface": "1.0.1"
|
|
30
30
|
}
|
|
31
31
|
}
|
package/src/Interaction.ts
CHANGED
|
@@ -146,20 +146,20 @@ export class Interaction extends InteractionBase {
|
|
|
146
146
|
protected onPointerDown(e: PointerEvent): void {
|
|
147
147
|
this.preventDefaultPointer(e)
|
|
148
148
|
|
|
149
|
+
if (this.config.pointer.touch || this.useMultiTouch) return
|
|
149
150
|
this.usePointer || (this.usePointer = true)
|
|
150
|
-
if (this.useMultiTouch) return
|
|
151
151
|
this.pointerDown(PointerEventHelper.convert(e, this.getLocal(e)))
|
|
152
152
|
}
|
|
153
153
|
|
|
154
154
|
protected onPointerMove(e: PointerEvent): void {
|
|
155
|
+
if (this.config.pointer.touch || this.useMultiTouch || this.preventWindowPointer(e)) return
|
|
155
156
|
this.usePointer || (this.usePointer = true)
|
|
156
|
-
if (this.useMultiTouch || this.preventWindowPointer(e)) return
|
|
157
157
|
this.pointerMove(PointerEventHelper.convert(e, this.getLocal(e, true)))
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
protected onPointerUp(e: PointerEvent): void {
|
|
161
161
|
if (this.downData) this.preventDefaultPointer(e)
|
|
162
|
-
if (this.useMultiTouch || this.preventWindowPointer(e)) return
|
|
162
|
+
if (this.config.pointer.touch || this.useMultiTouch || this.preventWindowPointer(e)) return
|
|
163
163
|
this.pointerUp(PointerEventHelper.convert(e, this.getLocal(e)))
|
|
164
164
|
}
|
|
165
165
|
|
|
@@ -238,7 +238,7 @@ export class Interaction extends InteractionBase {
|
|
|
238
238
|
|
|
239
239
|
// multiTouch
|
|
240
240
|
protected multiTouchStart(e: TouchEvent): void {
|
|
241
|
-
this.useMultiTouch = (e.touches.length
|
|
241
|
+
this.useMultiTouch = (e.touches.length > 1)
|
|
242
242
|
this.touches = this.useMultiTouch ? this.getTouches(e.touches) : undefined
|
|
243
243
|
if (this.useMultiTouch) this.pointerCancel()
|
|
244
244
|
}
|