Fix D&D viewport position calculation
It is necessary to transform screen position to viewport position.
This commit is contained in:
parent
13a0d6e9b2
commit
4b6516c843
|
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue