|
@@ -204,17 +204,17 @@ export default class Layer {
|
|
|
//记录开始的两个触摸点的坐标
|
|
|
if (!this.StorePage1 || !this.StorePage2) {
|
|
|
this.onMouseUp(e);
|
|
|
- this.StorePage1 = { x: ev.touches[0].pageX, y: ev.touches[0].pageY };
|
|
|
- this.StorePage2 = { x: ev.touches[1].pageX, y: ev.touches[1].pageY };
|
|
|
+ this.StorePage1 = { x: e.touches[0].pageX, y: e.touches[0].pageY };
|
|
|
+ this.StorePage2 = { x: e.touches[1].pageX, y: e.touches[1].pageY };
|
|
|
return;
|
|
|
}
|
|
|
const point1 = {
|
|
|
- x: ev.touches[0].pageX,
|
|
|
- y: ev.touches[0].pageY,
|
|
|
+ x: e.touches[0].pageX,
|
|
|
+ y: e.touches[0].pageY,
|
|
|
};
|
|
|
const point2 = {
|
|
|
- x: ev.touches[1].pageX,
|
|
|
- y: ev.touches[1].pageY,
|
|
|
+ x: e.touches[1].pageX,
|
|
|
+ y: e.touches[1].pageY,
|
|
|
};
|
|
|
|
|
|
// let zoom =
|
|
@@ -223,8 +223,9 @@ export default class Layer {
|
|
|
// coordinate.defaultZoom;
|
|
|
let zoom =
|
|
|
coordinate.defaultZoom +
|
|
|
- mathUtil.getDistance(this.StorePage1, this.StorePage2) -
|
|
|
- mathUtil.getDistance(point1, point2);
|
|
|
+ mathUtil.getDistance(point1, point2) -
|
|
|
+ mathUtil.getDistance(this.StorePage1, this.StorePage2);
|
|
|
+
|
|
|
this.zoomVector(zoom);
|
|
|
return;
|
|
|
}
|