diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2013-04-26 14:49:30 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2013-04-26 14:49:30 +0200 |
commit | 605dee007b10fbca1a03b0a2b604b4e999ad7c0f (patch) | |
tree | da83b6768bf909e37b07ff9b37822686690f25a5 /plugingui | |
parent | abe157edbae109b9436e388fbdb0a1d2e65ebb3c (diff) |
Don't set value if the value is the same (and save a repaintEvent)
Diffstat (limited to 'plugingui')
-rw-r--r-- | plugingui/scrollbar.cc | 4 |
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) |