From 8a44cf0342757fa26eec0b9191ea8a515a26eb07 Mon Sep 17 00:00:00 2001 From: Manny-OnGit Date: Fri, 14 Jun 2024 12:10:04 -0700 Subject: [PATCH] fixed issue #93043, ruler tool prevents new nodes from being added with right click. --- editor/plugins/canvas_item_editor_plugin.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 39743c16317..ee5d90b1f9b 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -2525,6 +2525,12 @@ bool CanvasItemEditor::_gui_input_ruler_tool(const Ref &p_event) { ruler_tool_origin = snap_point(viewport->get_local_mouse_position() / zoom + view_offset); } + if (ruler_tool_active && b.is_valid() && b->get_button_index() == MouseButton::RIGHT) { + ruler_tool_active = false; + viewport->queue_redraw(); + return true; + } + if (b.is_valid() && b->get_button_index() == MouseButton::LEFT) { if (b->is_pressed()) { ruler_tool_active = true; @@ -2623,10 +2629,10 @@ void CanvasItemEditor::_gui_input_viewport(const Ref &p_event) { // print_line("Move"); } else if (_gui_input_anchors(p_event)) { // print_line("Anchors"); - } else if (_gui_input_select(p_event)) { - // print_line("Selection"); } else if (_gui_input_ruler_tool(p_event)) { // print_line("Measure"); + } else if (_gui_input_select(p_event)) { + // print_line("Selection"); } else { // print_line("Not accepted"); accepted = false;