Closed bensweet86 closed 3 years ago
Are you definitely sure that the this.ongoingGesture
(a single variable) should be overwritten for each changedTouches
(i.e. twice) and their order doesn't matter in this case?
Resonably sure. Each removePointer function returns the this object and each performs a match that the incoming pointer id matches up with either the 1st or 2nd pointerId. Have tested this modification on Edge / Chrome, Safari (IOS14) and Chrome (Android). Interestingly the original code works fine for an Android, it looked like an IOS thing where it simultaneous finger lift from a pinch zoom resulted in 2x elements in the changedTouches object passed to the pointerUp function. Bug is in RE and the original Valetudo, been meaning to look into for a while. When this.ongoingGesture exists as type OngoingPan, there is a pointerId and pointer2Id which is what the 2x pointerUp touches align with.
Okay, thank you!
Bugfix to address https://github.com/rand256/valetudo/issues/90
PointerUp event seems to work find on Android devices but breaks with IOS when both fingers lifted within the same event. Original code only handled [0]th element and didn't correctly remove both finger lifts from this same event.