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;