You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-17 14:11:06 +00:00
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:
@@ -824,10 +824,6 @@ void TextureRegionEditor::_notification(int p_what) {
|
||||
[[fallthrough]];
|
||||
}
|
||||
|
||||
case NOTIFICATION_READY: {
|
||||
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")));
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_ENTER_TREE: {
|
||||
get_tree()->connect("node_removed", callable_mp(this, &TextureRegionEditor::_node_removed));
|
||||
|
||||
@@ -835,6 +831,9 @@ void TextureRegionEditor::_notification(int p_what) {
|
||||
if (snap_mode == SNAP_AUTOSLICE && is_visible() && autoslice_is_dirty) {
|
||||
_update_autoslice();
|
||||
}
|
||||
|
||||
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")));
|
||||
panner->set_viewport(get_viewport());
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_EXIT_TREE: {
|
||||
|
||||
Reference in New Issue
Block a user