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);
|
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_valid() && b->get_button_index() == MouseButton::LEFT) {
|
||||||
if (b->is_pressed()) {
|
if (b->is_pressed()) {
|
||||||
ruler_tool_active = true;
|
ruler_tool_active = true;
|
||||||
@ -2623,10 +2629,10 @@ void CanvasItemEditor::_gui_input_viewport(const Ref<InputEvent> &p_event) {
|
|||||||
// print_line("Move");
|
// print_line("Move");
|
||||||
} else if (_gui_input_anchors(p_event)) {
|
} else if (_gui_input_anchors(p_event)) {
|
||||||
// print_line("Anchors");
|
// print_line("Anchors");
|
||||||
} else if (_gui_input_select(p_event)) {
|
|
||||||
// print_line("Selection");
|
|
||||||
} else if (_gui_input_ruler_tool(p_event)) {
|
} else if (_gui_input_ruler_tool(p_event)) {
|
||||||
// print_line("Measure");
|
// print_line("Measure");
|
||||||
|
} else if (_gui_input_select(p_event)) {
|
||||||
|
// print_line("Selection");
|
||||||
} else {
|
} else {
|
||||||
// print_line("Not accepted");
|
// print_line("Not accepted");
|
||||||
accepted = false;
|
accepted = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user