From de568fc111e53de11aed1c3185cbc030a7c5272a Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Wed, 7 Feb 2018 03:13:33 -0500 Subject: [PATCH] Avoid some needless repaints of AButton --- src/widgets/AButton.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/widgets/AButton.cpp b/src/widgets/AButton.cpp index 30510744a..2d2f752f9 100644 --- a/src/widgets/AButton.cpp +++ b/src/widgets/AButton.cpp @@ -516,18 +516,22 @@ void AButton::Disable() void AButton::PushDown() { - mButtonIsDown = true; - this->Refresh(false); + if (!mButtonIsDown) { + mButtonIsDown = true; + this->Refresh(false); + } } void AButton::PopUp() { - mButtonIsDown = false; + if (mButtonIsDown) { + mButtonIsDown = false; + + this->Refresh(false); + } if (GetCapture()==this) ReleaseMouse(); - - this->Refresh(false); } void AButton::Click()