summaryrefslogtreecommitdiff
path: root/src/gui/widgets/progressbar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/progressbar.cpp')
-rw-r--r--src/gui/widgets/progressbar.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gui/widgets/progressbar.cpp b/src/gui/widgets/progressbar.cpp
index 359cbf49..7cc020ef 100644
--- a/src/gui/widgets/progressbar.cpp
+++ b/src/gui/widgets/progressbar.cpp
@@ -43,13 +43,17 @@ ProgressBar::ProgressBar(float progress,
int width, int height,
const gcn::Color &color):
gcn::Widget(),
- mProgress(progress),
- mProgressToGo(progress),
mSmoothProgress(true),
mColor(color),
mColorToGo(color),
mSmoothColorChange(true)
{
+ // 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)