diff options
| author | Rémi Verschelde <rverschelde@gmail.com> | 2018-04-19 21:06:17 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-04-19 21:06:17 +0200 |
| commit | 8ae042a895a3527079a8b4fb6ef4e1a78a45a358 (patch) | |
| tree | c111e06bc4b50e30ec5da5a9ec3109d168b053c1 /core/os/input_event.cpp | |
| parent | fab28cc0f3f7ac7fa6cf05e260f7571300943b83 (diff) | |
| parent | 7e89dc432c8781114f4855d6d2f24675a5a1ce5f (diff) | |
Merge pull request #18280 from groud/fix_input
Fixes left/up axis not mappable as actions
Diffstat (limited to 'core/os/input_event.cpp')
| -rw-r--r-- | core/os/input_event.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/os/input_event.cpp b/core/os/input_event.cpp index bdb61cbfd9..5003be77ab 100644 --- a/core/os/input_event.cpp +++ b/core/os/input_event.cpp @@ -656,10 +656,10 @@ bool InputEventJoypadMotion::action_match(const Ref<InputEvent> &p_event, bool * if (jm.is_null()) return false; - bool match = (axis == jm->axis && ((axis_value < 0) == (jm->axis_value < 0) || jm->axis_value == 0)); + bool match = (axis == jm->axis && (((axis_value < 0) == (jm->axis_value < 0)) || jm->axis_value == 0)); if (match) { if (p_pressed != NULL) - *p_pressed = Math::abs(jm->get_axis_value() >= p_deadzone); + *p_pressed = Math::abs(jm->get_axis_value()) >= p_deadzone; if (p_strength != NULL) *p_strength = (*p_pressed) ? Math::inverse_lerp(p_deadzone, 1.0f, Math::abs(jm->get_axis_value())) : 0.0f; } |