summaryrefslogtreecommitdiff
path: root/src/gui/widgets/spellshortcutcontainer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/spellshortcutcontainer.cpp')
-rw-r--r--src/gui/widgets/spellshortcutcontainer.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/gui/widgets/spellshortcutcontainer.cpp b/src/gui/widgets/spellshortcutcontainer.cpp
index 07ecbfaf0..7818dc8dc 100644
--- a/src/gui/widgets/spellshortcutcontainer.cpp
+++ b/src/gui/widgets/spellshortcutcontainer.cpp
@@ -111,20 +111,26 @@ void SpellShortcutContainer::draw(gcn::Graphics *graphics)
int selectedId = spellShortcut->getSelectedItem();
g->setColor(getForegroundColor());
+ if (mBackgroundImg)
+ {
+ for (unsigned i = 0; i < mMaxItems; i++)
+ {
+ g->drawImage(mBackgroundImg, (i % mGridWidth) * mBoxWidth,
+ (i / mGridWidth) * mBoxHeight);
+ }
+ }
+
for (unsigned i = 0; i < mMaxItems; i++)
{
const int itemX = (i % mGridWidth) * mBoxWidth;
const int itemY = (i / mGridWidth) * mBoxHeight;
- g->drawImage(mBackgroundImg, itemX, itemY);
-
int itemId = spellShortcut->getItem(
(mNumber * SPELL_SHORTCUT_ITEMS) + i);
if (selectedId >= 0 && itemId == selectedId)
{
- g->drawRectangle(gcn::Rectangle(
- itemX + 1, itemY + 1,
- mBoxWidth - 1, mBoxHeight - 1));
+ g->drawRectangle(gcn::Rectangle(itemX + 1, itemY + 1,
+ mBoxWidth - 1, mBoxHeight - 1));
}
if (!spellManager)