summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorTametomo <irarice@gmail.com>2009-05-12 12:19:46 -0600
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2010-02-14 20:54:02 +0100
commit751f21a4bde7384dd91b376c151d01d4b3d5cf9d (patch)
tree9abc7e5e86fb1b7a64cec5137ba8c6e9de65b4d2 /src/gui
parent2c78f1565306b37b0f728762a398fb3951322b0c (diff)
downloadmana-751f21a4bde7384dd91b376c151d01d4b3d5cf9d.tar.gz
mana-751f21a4bde7384dd91b376c151d01d4b3d5cf9d.tar.bz2
mana-751f21a4bde7384dd91b376c151d01d4b3d5cf9d.tar.xz
mana-751f21a4bde7384dd91b376c151d01d4b3d5cf9d.zip
Reduce the number of necessary logic checks, in order to improve
performance in ProgressBar logic loops. Signed-off-by: Tametomo <irarice@gmail.com>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/widgets/progressbar.cpp4
1 files changed, 2 insertions, 2 deletions
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)