# HG changeset patch # User Sebastien Jodogne # Date 1575648357 -3600 # Node ID 6f3f1ef347a3f6328d43eea2867d8c8affaef67f # Parent c04d0aa40f73e58fdb51f5314f122f379d5aea11 fix OneGesturePointerTracker if mouse release is outside the canvas diff -r c04d0aa40f73 -r 6f3f1ef347a3 Framework/Scene2DViewport/OneGesturePointerTracker.cpp --- a/Framework/Scene2DViewport/OneGesturePointerTracker.cpp Thu Dec 05 18:34:56 2019 +0100 +++ b/Framework/Scene2DViewport/OneGesturePointerTracker.cpp Fri Dec 06 17:05:57 2019 +0100 @@ -55,6 +55,15 @@ // the number of active touches currentTouchCount_++; LOG(INFO) << "currentTouchCount_ becomes: " << currentTouchCount_; + + /** + * 2019-12-06 (SJO): Patch to have consistent behavior when mouse + * leaves the canvas while the tracker is still active, then + * button is released while out-of-canvas. Such an event is not + * catched (at least in WebAssembly), so we delete the tracker on + * the next click inside the canvas. + **/ + alive_ = false; } bool OneGesturePointerTracker::IsAlive() const diff -r c04d0aa40f73 -r 6f3f1ef347a3 Framework/Scene2DViewport/ViewportController.h --- a/Framework/Scene2DViewport/ViewportController.h Thu Dec 05 18:34:56 2019 +0100 +++ b/Framework/Scene2DViewport/ViewportController.h Fri Dec 06 17:05:57 2019 +0100 @@ -218,6 +218,11 @@ return scene_; } + bool HasActiveTracker() const + { + return activeTracker_.get() != NULL; + } + private: double GetCanvasToSceneFactor() const;