Merge pull request #86511 from Sauermann/fix-drag-transform

Fix D&D viewport position calculation
This commit is contained in:
Rémi Verschelde 2024-01-02 18:05:23 +01:00
commit 60b20963ce
No known key found for this signature in database
GPG Key ID: C3336907360768E1

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());
}
}
}