diff --git a/gui/widget.cpp b/gui/widget.cpp index ade68fd46d8..5754c12dd13 100644 --- a/gui/widget.cpp +++ b/gui/widget.cpp @@ -328,7 +328,11 @@ void SliderWidget::handleMouseWheel(int x, int y, int direction) { } void SliderWidget::drawWidget() { - g_gui.theme()->drawSlider(Common::Rect(_x, _y, _x + _w, _y + _h), valueToPos(_value) + 1, _state); + g_gui.theme()->drawSlider(Common::Rect(_x, _y, _x + _w, _y + _h), valueToBarWidth(_value), _state); +} + +int SliderWidget::valueToBarWidth(int value) { + return (_w * (value - _valueMin) / (_valueMax - _valueMin)); } int SliderWidget::valueToPos(int value) { diff --git a/gui/widget.h b/gui/widget.h index 39bf81b352a..6fc4113ca65 100644 --- a/gui/widget.h +++ b/gui/widget.h @@ -236,6 +236,7 @@ protected: int valueToPos(int value); int posToValue(int pos); + int valueToBarWidth(int value); }; /* GraphicsWidget */