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
1 changed files with 1 additions and 1 deletions
|
@ -2073,7 +2073,7 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) {
|
||||||
Window *w = Object::cast_to<Window>(ObjectDB::get_instance(object_under));
|
Window *w = Object::cast_to<Window>(ObjectDB::get_instance(object_under));
|
||||||
if (w) {
|
if (w) {
|
||||||
viewport_under = 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 a new issue