Fix D&D viewport position calculation

It is necessary to transform screen position to viewport position.

(cherry picked from commit 4b6516c843)
This commit is contained in:
Markus Sauermann 2023-12-25 23:32:29 +01:00 committed by Yuri Sizov
parent dd665988d7
commit 6f6a1dc5e9

View File

@ -2081,7 +2081,7 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) {
Window *w = Object::cast_to<Window>(ObjectDB::get_instance(object_under));
if (w) {
viewport_under = w;
viewport_pos = screen_mouse_pos - w->get_position();
viewport_pos = w->get_final_transform().affine_inverse().xform(screen_mouse_pos - w->get_position());
}
}
}