diff options
Diffstat (limited to 'src/gui/widgets/progressbar.cpp')
-rw-r--r-- | src/gui/widgets/progressbar.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gui/widgets/progressbar.cpp b/src/gui/widgets/progressbar.cpp index 134d071f..7cc020ef 100644 --- a/src/gui/widgets/progressbar.cpp +++ b/src/gui/widgets/progressbar.cpp @@ -43,14 +43,17 @@ ProgressBar::ProgressBar(float progress, int width, int height, const gcn::Color &color): gcn::Widget(), - mProgress(0.0f), - mProgressToGo(0.0f), mSmoothProgress(true), mColor(color), mColorToGo(color), mSmoothColorChange(true) { - setProgress(progress); + // The progress value is directly set at load time: + if (progress > 1.0f || progress < 0.0f) + progress = 1.0f; + + mProgress = mProgressToGo = progress; + setSize(width, height); if (mInstances == 0) |