1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-09 12:50:35 +00:00

Handle warped mouse motion as floating point

Fixes certain issues where sub-pixel motions would get discarded while
the mouse is captured, such as when free look is enabled in the editor
(at least when turned on while holding right click).

Very slightly compat breaking, as actual public APIs are changed,
although with "compatible" types (Point2i->Point2).
This commit is contained in:
Riteo
2024-02-14 22:37:51 +01:00
parent 907db8eebc
commit 759a32eb0c
4 changed files with 10 additions and 10 deletions

View File

@@ -2572,8 +2572,8 @@ void Node3DEditorViewport::scale_freelook_speed(real_t scale) {
surface->queue_redraw();
}
Point2i Node3DEditorViewport::_get_warped_mouse_motion(const Ref<InputEventMouseMotion> &p_ev_mouse_motion) const {
Point2i relative;
Point2 Node3DEditorViewport::_get_warped_mouse_motion(const Ref<InputEventMouseMotion> &p_ev_mouse_motion) const {
Point2 relative;
if (bool(EDITOR_GET("editors/3d/navigation/warped_mouse_panning"))) {
relative = Input::get_singleton()->warp_mouse_motion(p_ev_mouse_motion, surface->get_global_rect());
} else {