| 178 | } |
| 179 | |
| 180 | void ViewportNavigationControl::_process_click(int p_index, Vector2 p_position, bool p_pressed) { |
| 181 | hovered = false; |
| 182 | queue_redraw(); |
| 183 | |
| 184 | if (focused_index != -1 && focused_index != p_index) { |
| 185 | return; |
| 186 | } |
| 187 | if (p_pressed) { |
| 188 | if (p_position.distance_to(get_size() / 2.0) < get_size().x / 2.0) { |
| 189 | focused_pos = p_position; |
| 190 | focused_index = p_index; |
| 191 | queue_redraw(); |
| 192 | } |
| 193 | } else { |
| 194 | focused_index = -1; |
| 195 | if (Input::get_singleton()->get_mouse_mode() == Input::MOUSE_MODE_CAPTURED) { |
| 196 | Input::get_singleton()->set_mouse_mode(Input::MOUSE_MODE_VISIBLE); |
| 197 | Input::get_singleton()->warp_mouse(focused_mouse_start); |
| 198 | } |
| 199 | } |
| 200 | } |
| 201 | |
| 202 | void ViewportNavigationControl::_process_drag(int p_index, Vector2 p_position, Vector2 p_relative_position) { |
| 203 | if (focused_index == p_index) { |
nothing calls this directly
no test coverage detected