diff --git a/NEWS.md b/NEWS.md index 405170c8a..5b062669f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -77,4 +77,5 @@ Many bugs have been fixed, and numerous features that were only partially implem * Hidden files still showed up if they had a gamelist.xml entry * On Unix, adding a hidden folder with a game in it crashed the application on startup * If the user tried to enter a blank game name in the metadata editor, the application would crash upon saving +* The SliderComponent knob position was set incorrectly if the minimum value was not zero * Lots and lots of additional small bugs and inconsistencies fixed diff --git a/es-core/src/components/SliderComponent.cpp b/es-core/src/components/SliderComponent.cpp index 7a928b914..86d48fbcf 100644 --- a/es-core/src/components/SliderComponent.cpp +++ b/es-core/src/components/SliderComponent.cpp @@ -147,7 +147,7 @@ void SliderComponent::onValueChanged() mKnob.setResize(0, mSize.y() * 0.7f); float lineLength = mSize.x() - mKnob.getSize().x() - (mValueCache ? mValueCache->metrics.size.x() + 4 : 0); - mKnob.setPosition(((mValue + mMin) / mMax) * lineLength + + mKnob.setPosition((mValue / mMax) * lineLength + mKnob.getSize().x()/2, mSize.y() / 2); }