Ver código fonte

继续支持移动端

xushiting 2 anos atrás
pai
commit
72c5874c02
1 arquivos alterados com 6 adições e 1 exclusões
  1. 6 1
      src/graphic/Layer.js

+ 6 - 1
src/graphic/Layer.js

@@ -187,7 +187,7 @@ export default class Layer {
       //切换到缩放
       //切换到缩放
       if (e.touches.length > 1) {
       if (e.touches.length > 1) {
         //记录开始的两个触摸点的坐标
         //记录开始的两个触摸点的坐标
-        if (this.StorePage1 == null || this.StorePage2 == null) {
+        if (!this.StorePage1 || !this.StorePage2) {
           this.onMouseUp(e);
           this.onMouseUp(e);
           this.StorePage1 = { x: ev.touches[0].pageX, y: ev.touches[0].pageY };
           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.StorePage2 = { x: ev.touches[1].pageX, y: ev.touches[1].pageY };
@@ -631,6 +631,11 @@ export default class Layer {
     if (e instanceof TouchEvent) {
     if (e instanceof TouchEvent) {
       X = this.lastX;
       X = this.lastX;
       Y = this.lastY;
       Y = this.lastY;
+      if (e.touches.length > 1) {
+        return;
+      }
+      this.StorePage1 == null;
+      this.StorePage2 == null;
     }
     }
 
 
     let eventName = stateService.getEventName();
     let eventName = stateService.getEventName();