Fix D&D viewport position calculation

It is necessary to transform screen position to viewport position.
This commit is contained in:
Markus Sauermann 2023-12-25 23:32:29 +01:00
parent 13a0d6e9b2
commit 4b6516c843
1 changed files with 1 additions and 1 deletions

View File

@ -2073,7 +2073,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());
}
}
}