mirror of
https://github.com/godotengine/godot
synced 2024-09-05 12:28:27 +00:00
Merge pull request #93174 from MannyFluss/master
Fix ruler tool sticks after right click
This commit is contained in:
commit
e536ab405f
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue