|
@@ -312,6 +312,7 @@ export class SCanvasView extends SObject {
|
|
protected onTouchStart(event: TouchEvent): void {
|
|
protected onTouchStart(event: TouchEvent): void {
|
|
let touches = event.touches;
|
|
let touches = event.touches;
|
|
if (touches.length == 1) {
|
|
if (touches.length == 1) {
|
|
|
|
+ this._touchState = STouchState.Move;
|
|
this._touchPoint.x = event.touches[0].clientX;
|
|
this._touchPoint.x = event.touches[0].clientX;
|
|
this._touchPoint.y = event.touches[0].clientY;
|
|
this._touchPoint.y = event.touches[0].clientY;
|
|
}
|
|
}
|
|
@@ -328,13 +329,13 @@ export class SCanvasView extends SObject {
|
|
*/
|
|
*/
|
|
protected onTouchMove(event: TouchEvent): void {
|
|
protected onTouchMove(event: TouchEvent): void {
|
|
let touches = event.touches;
|
|
let touches = event.touches;
|
|
- if (touches.length == 1) {
|
|
|
|
|
|
+ if (touches.length == 1 && this._touchState == STouchState.Move) {
|
|
this.origin.x += event.touches[0].clientX - this._touchPoint.x;
|
|
this.origin.x += event.touches[0].clientX - this._touchPoint.x;
|
|
this.origin.y += event.touches[0].clientY - this._touchPoint.y;
|
|
this.origin.y += event.touches[0].clientY - this._touchPoint.y;
|
|
this._touchPoint.x = event.touches[0].clientX;
|
|
this._touchPoint.x = event.touches[0].clientX;
|
|
this._touchPoint.y = event.touches[0].clientY;
|
|
this._touchPoint.y = event.touches[0].clientY;
|
|
}
|
|
}
|
|
- if (touches.length == 2) {
|
|
|
|
|
|
+ if (touches.length == 2 && this._touchState == STouchState.Zoom) {
|
|
this.viewZoom(event);
|
|
this.viewZoom(event);
|
|
}
|
|
}
|
|
this.update();
|
|
this.update();
|
|
@@ -346,7 +347,10 @@ export class SCanvasView extends SObject {
|
|
* @param event 事件参数
|
|
* @param event 事件参数
|
|
*/
|
|
*/
|
|
protected onTouchEnd(event: TouchEvent): void {
|
|
protected onTouchEnd(event: TouchEvent): void {
|
|
- this._touchState = STouchState.None;
|
|
|
|
|
|
+ const touches = event.touches.length;
|
|
|
|
+ if (touches == 0) {
|
|
|
|
+ this._touchState = STouchState.None;
|
|
|
|
+ }
|
|
} // Function onTouchEnd()
|
|
} // Function onTouchEnd()
|
|
|
|
|
|
/**
|
|
/**
|