From 5abcba0bef1457477d03e938a8ccf5d5d1705f8d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 9 Oct 2000 23:25:27 +0000 Subject: [PATCH] drastically reduced scrollbar flicker when thumb is being dragged git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8507 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/univ/scrolbar.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/univ/scrolbar.cpp b/src/univ/scrolbar.cpp index bca063c5b2..b53def2ffa 100644 --- a/src/univ/scrolbar.cpp +++ b/src/univ/scrolbar.cpp @@ -129,7 +129,8 @@ wxScrollBar::~wxScrollBar() void wxScrollBar::DoSetThumb(int pos) { - // don't do checks here, we're a private function + // don't assert hecks here, we're a private function which is meant to be + // called with any args at all if ( pos < 0 ) { pos = 0; @@ -139,6 +140,12 @@ void wxScrollBar::DoSetThumb(int pos) pos = m_range - m_thumbSize; } + if ( m_thumbPos == pos ) + { + // nothing changed, avoid refreshes which would provoke flicker + return; + } + if ( m_thumbPosOld == -1 ) { // remember the old thumb position