@leafer-ui/event 1.9.6 → 1.9.8
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 +3 -3
- package/src/DragEvent.ts +3 -3
- package/src/RotateEvent.ts +1 -0
- package/src/ZoomEvent.ts +1 -0
- package/types/index.d.ts +3 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer-ui/event",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.8",
|
|
4
4
|
"description": "@leafer-ui/event",
|
|
5
5
|
"author": "Chao (Leafer) Wan",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
"leaferjs"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@leafer/core": "1.9.
|
|
25
|
+
"@leafer/core": "1.9.8"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@leafer/interface": "1.9.
|
|
28
|
+
"@leafer/interface": "1.9.8"
|
|
29
29
|
}
|
|
30
30
|
}
|
package/src/DragEvent.ts
CHANGED
|
@@ -38,9 +38,9 @@ export class DragEvent extends PointerEvent implements IDragEvent {
|
|
|
38
38
|
this.data = data
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
static getValidMove(leaf: ILeaf,
|
|
42
|
-
const move = leaf.getLocalPoint(
|
|
43
|
-
PointHelper.move(move,
|
|
41
|
+
static getValidMove(leaf: ILeaf, localStart: IPointData, worldTotal: IPointData, checkLimit = true): IPointData {
|
|
42
|
+
const move = leaf.getLocalPoint(worldTotal, null, true)
|
|
43
|
+
PointHelper.move(move, localStart.x - leaf.x, localStart.y - leaf.y)
|
|
44
44
|
if (checkLimit) this.limitMove(leaf, move)
|
|
45
45
|
DragBoundsHelper.axisMove(leaf, move)
|
|
46
46
|
return move
|
package/src/RotateEvent.ts
CHANGED
package/src/ZoomEvent.ts
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -79,7 +79,7 @@ declare class DragEvent extends PointerEvent implements IDragEvent {
|
|
|
79
79
|
static data: IObject;
|
|
80
80
|
static setList(data: ILeaf | ILeaf[] | ILeafList): void;
|
|
81
81
|
static setData(data: IObject): void;
|
|
82
|
-
static getValidMove(leaf: ILeaf,
|
|
82
|
+
static getValidMove(leaf: ILeaf, localStart: IPointData, worldTotal: IPointData, checkLimit?: boolean): IPointData;
|
|
83
83
|
static limitMove(leaf: ILeaf, move: IPointData): void;
|
|
84
84
|
getPageMove(total?: boolean): IPointData;
|
|
85
85
|
getInnerMove(relative?: ILeaf, total?: boolean): IPointData;
|
|
@@ -114,6 +114,7 @@ declare class RotateEvent extends PointerEvent implements IRotateEvent {
|
|
|
114
114
|
static ROTATE: string;
|
|
115
115
|
static END: string;
|
|
116
116
|
readonly rotation: number;
|
|
117
|
+
readonly totalRotation: number;
|
|
117
118
|
}
|
|
118
119
|
|
|
119
120
|
declare class SwipeEvent extends DragEvent implements ISwipeEvent {
|
|
@@ -132,6 +133,7 @@ declare class ZoomEvent extends PointerEvent implements IZoomEvent {
|
|
|
132
133
|
static ZOOM: string;
|
|
133
134
|
static END: string;
|
|
134
135
|
readonly scale: number;
|
|
136
|
+
readonly totalScale: number;
|
|
135
137
|
}
|
|
136
138
|
|
|
137
139
|
declare class KeyEvent extends UIEvent implements IKeyEvent {
|