@leafer-ui/interaction-web 1.0.0-rc.23 → 1.0.0-rc.24
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 +2 -13
- package/types/index.d.ts +2 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer-ui/interaction-web",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.24",
|
|
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.0-rc.
|
|
26
|
-
"@leafer-ui/core": "1.0.0-rc.
|
|
25
|
+
"@leafer/core": "1.0.0-rc.24",
|
|
26
|
+
"@leafer-ui/core": "1.0.0-rc.24"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@leafer/interface": "1.0.0-rc.
|
|
29
|
+
"@leafer/interface": "1.0.0-rc.24"
|
|
30
30
|
}
|
|
31
31
|
}
|
package/src/Interaction.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IObject, IPointData, ITimer, IKeepTouchData, ICursorType } from '@leafer/interface'
|
|
1
|
+
import { IObject, IPointData, ITimer, IKeepTouchData, ICursorType, IClientPointData } from '@leafer/interface'
|
|
2
2
|
import { MathHelper } from '@leafer/core'
|
|
3
3
|
import { InteractionBase, InteractionHelper, Cursor } from '@leafer-ui/core'
|
|
4
4
|
|
|
@@ -7,12 +7,7 @@ import { WheelEventHelper } from './WheelEventHelper'
|
|
|
7
7
|
import { KeyEventHelper } from './KeyEventHelper'
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
interface
|
|
11
|
-
clientX: number
|
|
12
|
-
clientY: number
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
interface IGestureEvent extends IClientPoint, UIEvent {
|
|
10
|
+
interface IGestureEvent extends IClientPointData, UIEvent {
|
|
16
11
|
scale: number
|
|
17
12
|
rotation: number
|
|
18
13
|
preventDefault(): void
|
|
@@ -104,12 +99,6 @@ export class Interaction extends InteractionBase {
|
|
|
104
99
|
}
|
|
105
100
|
}
|
|
106
101
|
|
|
107
|
-
protected getLocal(p: IClientPoint, updateClient?: boolean): IPointData {
|
|
108
|
-
if (updateClient) this.canvas.updateClientBounds()
|
|
109
|
-
const { clientBounds } = this.canvas
|
|
110
|
-
return { x: p.clientX - clientBounds.x, y: p.clientY - clientBounds.y }
|
|
111
|
-
}
|
|
112
|
-
|
|
113
102
|
protected getTouches(touches: TouchList): Touch[] {
|
|
114
103
|
const list: Touch[] = []
|
|
115
104
|
for (let i = 0, len = touches.length; i < len; i++) {
|
package/types/index.d.ts
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import { IObject, ITimer,
|
|
1
|
+
import { IObject, ITimer, IKeepTouchData, IPointData, ICursorType, IClientPointData } from '@leafer/interface';
|
|
2
2
|
import { InteractionBase } from '@leafer-ui/core';
|
|
3
3
|
|
|
4
|
-
interface
|
|
5
|
-
clientX: number;
|
|
6
|
-
clientY: number;
|
|
7
|
-
}
|
|
8
|
-
interface IGestureEvent extends IClientPoint, UIEvent {
|
|
4
|
+
interface IGestureEvent extends IClientPointData, UIEvent {
|
|
9
5
|
scale: number;
|
|
10
6
|
rotation: number;
|
|
11
7
|
preventDefault(): void;
|
|
@@ -23,7 +19,6 @@ declare class Interaction extends InteractionBase {
|
|
|
23
19
|
protected lastGestureRotation: number;
|
|
24
20
|
protected __listenEvents(): void;
|
|
25
21
|
protected __removeListenEvents(): void;
|
|
26
|
-
protected getLocal(p: IClientPoint, updateClient?: boolean): IPointData;
|
|
27
22
|
protected getTouches(touches: TouchList): Touch[];
|
|
28
23
|
protected preventDefaultPointer(e: UIEvent): void;
|
|
29
24
|
protected preventDefaultWheel(e: UIEvent): void;
|