@leafer-ui/event 1.9.7 → 1.9.9

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer-ui/event",
3
- "version": "1.9.7",
3
+ "version": "1.9.9",
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.7"
25
+ "@leafer/core": "1.9.9"
26
26
  },
27
27
  "devDependencies": {
28
- "@leafer/interface": "1.9.7"
28
+ "@leafer/interface": "1.9.9"
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, start: IPointData, total: IPointData, checkLimit = true): IPointData {
42
- const move = leaf.getLocalPoint(total, null, true)
43
- PointHelper.move(move, start.x - leaf.x, start.y - leaf.y)
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
@@ -14,5 +14,6 @@ export class RotateEvent extends PointerEvent implements IRotateEvent {
14
14
  static END = 'rotate.end'
15
15
 
16
16
  readonly rotation: number
17
+ readonly totalRotation: number
17
18
 
18
19
  }
package/src/ZoomEvent.ts CHANGED
@@ -13,5 +13,6 @@ export class ZoomEvent extends PointerEvent implements IZoomEvent {
13
13
  static END = 'zoom.end'
14
14
 
15
15
  readonly scale: number
16
+ readonly totalScale: number
16
17
 
17
18
  }
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, start: IPointData, total: IPointData, checkLimit?: boolean): IPointData;
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 {