Fix missing event metadata in _input() with Input.parse_input_event()

Use merge_meta_from() for metadata copying.

Fixed include order

Removed unnecessary line
This commit is contained in:
Yelloween 2024-12-05 15:51:59 +03:00
parent 1f47e4c4e3
commit 98a23136d5

View File

@ -754,6 +754,8 @@ Ref<InputEvent> InputEventMouseButton::xformed_by(const Transform2D &p_xform, co
mb->set_factor(factor);
mb->set_button_index(button_index);
mb->merge_meta_from(this);
return mb;
}
@ -974,6 +976,8 @@ Ref<InputEvent> InputEventMouseMotion::xformed_by(const Transform2D &p_xform, co
mm->set_velocity(p_xform.basis_xform(get_velocity()));
mm->set_screen_velocity(get_screen_velocity());
mm->merge_meta_from(this);
return mm;
}
@ -1366,6 +1370,8 @@ Ref<InputEvent> InputEventScreenTouch::xformed_by(const Transform2D &p_xform, co
st->set_canceled(canceled);
st->set_double_tap(double_tap);
st->merge_meta_from(this);
return st;
}
@ -1494,6 +1500,8 @@ Ref<InputEvent> InputEventScreenDrag::xformed_by(const Transform2D &p_xform, con
sd->set_velocity(p_xform.basis_xform(velocity));
sd->set_screen_velocity(get_screen_velocity());
sd->merge_meta_from(this);
return sd;
}
@ -1705,6 +1713,8 @@ Ref<InputEvent> InputEventMagnifyGesture::xformed_by(const Transform2D &p_xform,
ev->set_position(p_xform.xform(get_position() + p_local_ofs));
ev->set_factor(get_factor());
ev->merge_meta_from(this);
return ev;
}
@ -1745,6 +1755,8 @@ Ref<InputEvent> InputEventPanGesture::xformed_by(const Transform2D &p_xform, con
ev->set_position(p_xform.xform(get_position() + p_local_ofs));
ev->set_delta(get_delta());
ev->merge_meta_from(this);
return ev;
}