Fix SDL controller reversed y axis in UI (#574)

This commit is contained in:
Tillsunset 2022-12-13 22:41:48 -06:00 committed by GitHub
parent c78b3da872
commit aea9f5b966
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -248,6 +248,12 @@ void DefaultControllerSettings::on_timer(wxTimerEvent& event)
m_controller->apply_axis_setting(state.rotation, default_state.rotation, m_settings.rotation); m_controller->apply_axis_setting(state.rotation, default_state.rotation, m_settings.rotation);
m_controller->apply_axis_setting(state.trigger, default_state.trigger, m_settings.trigger); m_controller->apply_axis_setting(state.trigger, default_state.trigger, m_settings.trigger);
if (m_controller->api() == InputAPI::SDLController)
{
state.axis.y *= -1;
state.rotation.y *= -1;
}
m_axis_draw->SetDeadzone(m_settings.axis.deadzone); m_axis_draw->SetDeadzone(m_settings.axis.deadzone);
m_axis_draw->SetAxisValue(state.axis); m_axis_draw->SetAxisValue(state.axis);