diff options
Diffstat (limited to 'plugingui/scrollbar.cc')
-rw-r--r-- | plugingui/scrollbar.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/plugingui/scrollbar.cc b/plugingui/scrollbar.cc index 0b10972..3107987 100644 --- a/plugingui/scrollbar.cc +++ b/plugingui/scrollbar.cc @@ -66,9 +66,15 @@ int GUI::ScrollBar::maximum() void GUI::ScrollBar::setValue(int value) { + if(value > max - ran) value = max - ran; + if(value < 0) value = 0; + + if(val == value) + { + return; + } + val = value; - if(val > max - ran) val = max - ran; - if(val < 0) val = 0; if(handler) handler(ptr); |