From 751f21a4bde7384dd91b376c151d01d4b3d5cf9d Mon Sep 17 00:00:00 2001 From: Tametomo Date: Tue, 12 May 2009 12:19:46 -0600 Subject: Reduce the number of necessary logic checks, in order to improve performance in ProgressBar logic loops. Signed-off-by: Tametomo --- src/gui/widgets/progressbar.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gui/widgets/progressbar.cpp') diff --git a/src/gui/widgets/progressbar.cpp b/src/gui/widgets/progressbar.cpp index 98c31873..d31b6853 100644 --- a/src/gui/widgets/progressbar.cpp +++ b/src/gui/widgets/progressbar.cpp @@ -94,7 +94,7 @@ ProgressBar::~ProgressBar() void ProgressBar::logic() { - if (mSmoothColorChange) + if (mSmoothColorChange && mColorToGo != mColor) { // Smoothly changing the color for a nicer effect. if (mColorToGo.r > mColor.r) @@ -111,7 +111,7 @@ void ProgressBar::logic() mColor.b--; } - if (mSmoothProgress) + if (mSmoothProgress && mProgressToGo != mProgress) { // Smoothly showing the progressbar changes. if (mProgressToGo > mProgress) -- cgit v1.2.3-70-g09d2