From 0dfe52586c5c7fefb974d5e1aa4415ecb552964d Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sat, 23 Jan 2021 15:43:48 +0100 Subject: [PATCH] Fixed an issue with adjusting SliderComponent values using the controller D-pad. --- es-core/src/components/SliderComponent.cpp | 31 +++++++++++++--------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/es-core/src/components/SliderComponent.cpp b/es-core/src/components/SliderComponent.cpp index 84191488b..62ee1c873 100644 --- a/es-core/src/components/SliderComponent.cpp +++ b/es-core/src/components/SliderComponent.cpp @@ -40,21 +40,26 @@ SliderComponent::SliderComponent( bool SliderComponent::input(InputConfig* config, Input input) { - if (config->isMappedLike("left", input)) { - if (input.value) - setValue(mValue - mSingleIncrement); + if (input.value != 0) { + if (config->isMappedLike("left", input)) { + if (input.value) + setValue(mValue - mSingleIncrement); - mMoveRate = input.value ? -mSingleIncrement : 0; - mMoveAccumulator = -MOVE_REPEAT_DELAY; - return true; + mMoveRate = input.value ? -mSingleIncrement : 0; + mMoveAccumulator = -MOVE_REPEAT_DELAY; + return true; + } + if (config->isMappedLike("right", input)) { + if (input.value) + setValue(mValue + mSingleIncrement); + + mMoveRate = input.value ? mSingleIncrement : 0; + mMoveAccumulator = -MOVE_REPEAT_DELAY; + return true; + } } - if (config->isMappedLike("right", input)) { - if (input.value) - setValue(mValue + mSingleIncrement); - - mMoveRate = input.value ? mSingleIncrement : 0; - mMoveAccumulator = -MOVE_REPEAT_DELAY; - return true; + else { + mMoveRate = 0; } return GuiComponent::input(config, input);