From 714891ace8c23017d81565d07525e751176c9b94 Mon Sep 17 00:00:00 2001 From: kobewi Date: Thu, 9 Jun 2022 14:02:58 +0200 Subject: [PATCH] Properly release LMB even while panning --- editor/plugins/canvas_item_editor_plugin.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 083b51f309e..f113eed2d5b 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -2771,7 +2771,10 @@ bool CanvasItemEditor::_gui_input_hover(const Ref &p_event) { void CanvasItemEditor::_gui_input_viewport(const Ref &p_event) { bool accepted = false; - if (EditorSettings::get_singleton()->get("editors/2d/simple_panning") || !pan_pressed) { + Ref mb = p_event; + bool release_lmb = (mb.is_valid() && !mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT); // Required to properly release some stuff (e.g. selection box) while panning. + + if (EditorSettings::get_singleton()->get("editors/2d/simple_panning") || !pan_pressed || release_lmb) { if ((accepted = _gui_input_rulers_and_guides(p_event))) { //printf("Rulers and guides\n"); } else if ((accepted = editor->get_editor_plugins_over()->forward_gui_input(p_event))) {