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:
parent
dd665988d7
commit
6f6a1dc5e9
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user