diff options
author | Torbjörn Andersson | 2012-12-27 10:13:48 +0100 |
---|---|---|
committer | Torbjörn Andersson | 2012-12-27 10:13:48 +0100 |
commit | 85beaf6fed59792046811231ce76ee08c593adf5 (patch) | |
tree | f1abeef2383e4989a0f0905e055787b2ac528ccb /gui | |
parent | 61b25b970703a3c062846249676921fec2e165d6 (diff) | |
download | scummvm-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')
-rw-r--r-- | gui/widget.cpp | 4 |
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; |