From 712b75e2088e74b04cbacfa7f315a1e8f1c0bf83 Mon Sep 17 00:00:00 2001 From: kovacsv Date: Sun, 12 Dec 2021 21:36:41 +0100 Subject: [PATCH] End event should handled for iOS. --- source/viewer/navigation.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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)