fixed issue #93043, ruler tool prevents new nodes from being added with right click.

This commit is contained in:
Manny-OnGit 2024-06-14 12:10:04 -07:00 committed by MannyFluss
parent b75f0485ba
commit 8a44cf0342
1 changed files with 8 additions and 2 deletions

View File

@ -2525,6 +2525,12 @@ bool CanvasItemEditor::_gui_input_ruler_tool(const Ref<InputEvent> &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<InputEvent> &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;