aboutsummaryrefslogtreecommitdiff
path: root/gui/widget.cpp
diff options
context:
space:
mode:
authorTorbjörn Andersson2012-12-27 10:13:48 +0100
committerTorbjörn Andersson2012-12-27 10:13:48 +0100
commit85beaf6fed59792046811231ce76ee08c593adf5 (patch)
treef1abeef2383e4989a0f0905e055787b2ac528ccb /gui/widget.cpp
parent61b25b970703a3c062846249676921fec2e165d6 (diff)
downloadscummvm-rg350-85beaf6fed59792046811231ce76ee08c593adf5.tar.gz
scummvm-rg350-85beaf6fed59792046811231ce76ee08c593adf5.tar.bz2
scummvm-rg350-85beaf6fed59792046811231ce76ee08c593adf5.zip
GUI: Change value by one on mouse wheel, not by one pixel
On file-grained sliders, changing the value by one pixel was unpredictable because it wouldn't change by the same amount every time. (And of course, some values were not possible to set.) On course-grained sliders, changing the value by one pixel would sometimes not change it at all, causing the slider to seem stuck. Now the slider can be set to any value.
Diffstat (limited to 'gui/widget.cpp')
-rw-r--r--gui/widget.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/gui/widget.cpp b/gui/widget.cpp
index 4ffb63e945..c3f10a861f 100644
--- a/gui/widget.cpp
+++ b/gui/widget.cpp
@@ -593,8 +593,8 @@ void SliderWidget::handleMouseUp(int x, int y, int button, int clickCount) {
void SliderWidget::handleMouseWheel(int x, int y, int direction) {
if (isEnabled() && !_isDragging) {
- // Increment or decrement one position
- int newValue = posToValue(valueToPos(_value) - 1 * direction);
+ // Increment or decrement by one
+ int newValue = _value - direction;
if (newValue < _valueMin)
newValue = _valueMin;