summaryrefslogtreecommitdiffstats
path: root/core/input/input.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2021-01-18 13:12:54 +0100
committerGitHub <noreply@github.com>2021-01-18 13:12:54 +0100
commit869f5b53288ec713553e024f91ec88b47ce960d9 (patch)
tree1462d44f94daab7f896f9a08def8e0fa32585513 /core/input/input.cpp
parent688f4aebef57e77e843b52cfb97c31f3ea426c0e (diff)
parentbab20c6e094cd40427fc76890c3aeef3a0ba4e1c (diff)
downloadredot-engine-869f5b53288ec713553e024f91ec88b47ce960d9.tar.gz
Merge pull request #45078 from Faless/js/4.x_gamepads
[HTML5] Use internal implementation of the Gamepad API.
Diffstat (limited to 'core/input/input.cpp')
-rw-r--r--core/input/input.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/input/input.cpp b/core/input/input.cpp
index c96884a7b3..2e3f112ebc 100644
--- a/core/input/input.cpp
+++ b/core/input/input.cpp
@@ -886,10 +886,10 @@ void Input::joy_axis(int p_device, int p_axis, const JoyAxis &p_value) {
jx.min = p_value.min;
jx.value = p_value.value < 0.5 ? 0.6 : 0.4;
joy_axis(p_device, p_axis, jx);
- } else if (ABS(last) > 0.5 && last * p_value.value < 0) {
+ } else if (ABS(last) > 0.5 && last * p_value.value <= 0) {
JoyAxis jx;
jx.min = p_value.min;
- jx.value = p_value.value < 0 ? 0.1 : -0.1;
+ jx.value = last > 0 ? 0.1 : -0.1;
joy_axis(p_device, p_axis, jx);
}