diff --git a/source/viewer/navigation.js b/source/viewer/navigation.js index d884dc3..dd4e351 100644 --- a/source/viewer/navigation.js +++ b/source/viewer/navigation.js @@ -133,6 +133,7 @@ OV.TouchInteraction = class if (ev.touches.length === 0) { return; } + this.currPos = this.GetPositionFromEvent (canvas, ev); this.diffPos = OV.SubCoord2D (this.currPos, this.prevPos); this.prevPos = this.currPos.Clone (); @@ -142,6 +143,17 @@ OV.TouchInteraction = class this.prevDist = this.currDist; } + End (canvas, ev) + { + if (ev.touches.length === 0) { + return; + } + + this.fingers = 0; + this.currPos = this.GetPositionFromEvent (canvas, ev); + this.currDist = this.GetTouchDistanceFromEvent (canvas, ev); + } + IsFingerDown () { return this.fingers !== 0; @@ -481,6 +493,8 @@ OV.Navigation = class OnTouchEnd (ev) { ev.preventDefault (); + + this.touch.End (this.canvas, ev); } OnMouseWheel (ev)