summaryrefslogtreecommitdiff
path: root/plugingui/scrollbar.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2013-04-26 14:49:30 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2013-04-26 14:49:30 +0200
commit605dee007b10fbca1a03b0a2b604b4e999ad7c0f (patch)
treeda83b6768bf909e37b07ff9b37822686690f25a5 /plugingui/scrollbar.cc
parentabe157edbae109b9436e388fbdb0a1d2e65ebb3c (diff)
Don't set value if the value is the same (and save a repaintEvent)
Diffstat (limited to 'plugingui/scrollbar.cc')
-rw-r--r--plugingui/scrollbar.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugingui/scrollbar.cc b/plugingui/scrollbar.cc
index 3fc3ac8..d48da1a 100644
--- a/plugingui/scrollbar.cc
+++ b/plugingui/scrollbar.cc
@@ -141,7 +141,9 @@ void GUI::ScrollBar::mouseMoveEvent(MouseMoveEvent *e)
int h = height() - 2 * width() - 3;
delta /= (float)h / (float)max;
- setValue(value_offset - delta);
+
+ int newval = value_offset - delta;
+ if(newval != value()) setValue(newval);
}
void GUI::ScrollBar::buttonEvent(ButtonEvent *e)