InputCommon: Eliminate some duplicated button threshold logic.

This commit is contained in:
Jordan Woyak
2020-02-08 20:36:26 -06:00
parent 2e2540317e
commit f07457b6cc
17 changed files with 50 additions and 45 deletions

View File

@ -32,7 +32,7 @@ Slider::Slider(const std::string& name_) : Slider(name_, name_)
Slider::StateData Slider::GetState()
{
const ControlState deadzone = m_deadzone_setting.GetValue() / 100;
const ControlState state = controls[1]->control_ref->State() - controls[0]->control_ref->State();
const ControlState state = controls[1]->GetState() - controls[0]->GetState();
return {std::clamp(ApplyDeadzone(state, deadzone), -1.0, 1.0)};
}