From 20b83191617617e7d73ebf8848b33b648c5bf456 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Thu, 12 Apr 2018 10:02:04 -0400 Subject: [PATCH] Forward mouse-released events to the navigation handler regardless of whether a callback has consumed them --- src/engine/openspaceengine.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index 99d2caf3c4..b9e1d2946c 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -1474,7 +1474,16 @@ void OpenSpaceEngine::mouseButtonCallback(MouseButton button, MouseAction action for (const auto& func : _moduleCallbacks.mouseButton) { bool consumed = func(button, action); if (consumed) { - return; + // If the mouse was released, we still want to forward it to the navigation + // handler in order to reliably terminate a rotation or zoom. Accidentally + // moving the cursor over a UI window is easy to miss and leads to weird + // continuing movement + if (action == MouseAction::Release) { + break; + } + else { + return; + } } }