diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2015-10-31 14:44:23 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2015-10-31 14:44:23 +0100 |
commit | 5d76d943eca9734f7df2dc351871815385c571b3 (patch) | |
tree | 6f395e870283b43702e75e320dd53ed316e22db9 /plugingui/scrollbar.cc | |
parent | bc931baa7a31857b971b9ac6543b2af20cdd1bf1 (diff) |
Font refactoring. Some rendering optimizations on ScrollBar, LineEdit and ListBoxBasic.
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); |