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.cpp25
1 files changed, 9 insertions, 16 deletions
diff --git a/src/gui/widgets/progressbar.cpp b/src/gui/widgets/progressbar.cpp
index 8b2beb8d5..4be421db4 100644
--- a/src/gui/widgets/progressbar.cpp
+++ b/src/gui/widgets/progressbar.cpp
@@ -211,24 +211,19 @@ void ProgressBar::render(Graphics *graphics, const gcn::Rectangle &area,
if (*redraw || graphics->getRedraw())
{
*redraw = false;
- static_cast<Graphics*>(graphics)->calcWindow(vert,
- area.x, area.y, area.width, area.height, mBorder);
+ graphics->calcWindow(vert, area.x, area.y,
+ area.width, area.height, mBorder);
}
- static_cast<Graphics*>(graphics)->drawImageRect2(vert, mBorder);
-
-// graphics->drawImageRect(area.x, area.y, area.width, area.height, mBorder);
-// graphics->drawImageRect(area, mBorder);
+ graphics->drawImageRect2(vert, mBorder);
// The bar
if (progress > 0)
{
graphics->setColor(color);
- graphics->fillRectangle(gcn::Rectangle(static_cast<int>(area.x + 4),
- static_cast<int>(area.y + 4),
- static_cast<int>(static_cast<float>(progress)
- * static_cast<float>(area.width - 8)),
- static_cast<int>(area.height - 8)));
+ graphics->fillRectangle(gcn::Rectangle(area.x + 4, area.y + 4,
+ static_cast<int>(progress * static_cast<float>(area.width - 8)),
+ area.height - 8));
}
// The label
@@ -260,11 +255,9 @@ void ProgressBar::render(Graphics *graphics, const gcn::Rectangle &area,
if (progress > 0)
{
graphics->setColor(color);
- graphics->fillRectangle(gcn::Rectangle(static_cast<int>(area.x + 4),
- static_cast<int>(area.y + 4),
- static_cast<int>(static_cast<float>(progress)
- * static_cast<float>(area.width - 8)),
- static_cast<int>(area.height - 8)));
+ graphics->fillRectangle(gcn::Rectangle(area.x + 4, area.y + 4,
+ static_cast<int>(progress * static_cast<float>(area.width - 8)),
+ area.height - 8));
}
// The label