summaryrefslogtreecommitdiff
path: root/plugingui/scrollbar.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2015-10-31 14:44:23 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2015-10-31 14:44:23 +0100
commit5d76d943eca9734f7df2dc351871815385c571b3 (patch)
tree6f395e870283b43702e75e320dd53ed316e22db9 /plugingui/scrollbar.cc
parentbc931baa7a31857b971b9ac6543b2af20cdd1bf1 (diff)
Font refactoring. Some rendering optimizations on ScrollBar, LineEdit and ListBoxBasic.
Diffstat (limited to 'plugingui/scrollbar.cc')
-rw-r--r--plugingui/scrollbar.cc10
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);