From b2111431fd6b0d840e883fe106b589e6b273f2c1 Mon Sep 17 00:00:00 2001 From: Andrew Harvey Date: Thu, 9 Mar 2017 22:06:37 +1100 Subject: [PATCH] Ensure DragRotate stops after releasing mouse button when Ctrl is already released. Fixes #1888 The DragRotateHandler._keyUp method fires on a mouseup event so it can stop the rotation/active state when you release the mouse button. However this method also fires due to other interactions with the map such as DragPan. So the _ignoreEvent method determines if the event mouseup or other is to be ignored because it doesn't affect the DragRotateHandler. This commit ensures that when the mouseup event happens on the left mouse button without the Ctrl key pressed and DragRotate is still active that the event is not ignored so that DragRotate can be deactivated. --- src/ui/handler/drag_rotate.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/handler/drag_rotate.js b/src/ui/handler/drag_rotate.js index 8511b872d80..33c6d1c21a5 100644 --- a/src/ui/handler/drag_rotate.js +++ b/src/ui/handler/drag_rotate.js @@ -210,7 +210,7 @@ class DragRotateHandler { // using Control + left click eventButton = 0; } - return (e.type === 'mousemove' ? e.buttons & buttons === 0 : eventButton !== button); + return (e.type === 'mousemove' ? e.buttons & buttons === 0 : !this.isActive() && eventButton !== button); } }