Merge pull request #88473 from Sauermann/fix-mouse-event-global-position
Fix global position for `InputEventMouse` in `viewport::push_input`
This commit is contained in:
commit
0c4d8d7a6c
1 changed files with 7 additions and 0 deletions
|
|
@ -1383,6 +1383,13 @@ Ref<InputEvent> Viewport::_make_input_local(const Ref<InputEvent> &ev) {
|
|||
}
|
||||
|
||||
Transform2D ai = get_final_transform().affine_inverse();
|
||||
Ref<InputEventMouse> me = ev;
|
||||
if (me.is_valid()) {
|
||||
me = me->xformed_by(ai);
|
||||
// For InputEventMouse, the global position is not adjusted by ev->xformed_by() and needs to be set separately.
|
||||
me->set_global_position(me->get_position());
|
||||
return me;
|
||||
}
|
||||
return ev->xformed_by(ai);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue