Fix ViewPanner panning mouse warp

Currently the mouse cursor jumps in unexpected ways, when a `ViewPanner`
is used in SubViewports or embedded Windows.

This is caused by providing wrong coordinate systems to
Input::warp_mouse_motion.

This PR replaces the use of `Input::warp_mouse_motion` with
`Viewport::wrap_mouse_in_rect` and makes sure, that the correct
coordinate systems are used.

This change makes it necessary, that all classes, that currently
use ViewPanner, need to provide the correct Viewport to ViewPanner.
This commit is contained in:
Markus Sauermann 2024-12-15 18:59:26 +01:00
parent b9437c3938
commit 4887172a59
15 changed files with 64 additions and 7 deletions

View file

@ -5188,6 +5188,7 @@ void VisualShaderEditor::_notification(int p_what) {
}
graph->get_panner()->setup((ViewPanner::ControlScheme)EDITOR_GET("editors/panning/sub_editors_panning_scheme").operator int(), ED_GET_SHORTCUT("canvas_item_editor/pan_view"), bool(EDITOR_GET("editors/panning/simple_panning")));
graph->get_panner()->set_viewport(get_viewport());
graph->set_warped_panning(bool(EDITOR_GET("editors/panning/warped_mouse_panning")));
} break;