From 81d317cf80f4c333396c708bbefca16be2362c8c Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 27 Dec 2012 01:09:30 +0300 Subject: Improve containders text draw speed. --- src/gui/widgets/spellshortcutcontainer.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/gui/widgets/spellshortcutcontainer.cpp') diff --git a/src/gui/widgets/spellshortcutcontainer.cpp b/src/gui/widgets/spellshortcutcontainer.cpp index af9457078..ee43a5d3f 100644 --- a/src/gui/widgets/spellshortcutcontainer.cpp +++ b/src/gui/widgets/spellshortcutcontainer.cpp @@ -40,6 +40,8 @@ #include "utils/gettext.h" +#include + #include "debug.h" SpellShortcutContainer::SpellShortcutContainer(const unsigned number) : @@ -102,8 +104,8 @@ void SpellShortcutContainer::draw(gcn::Graphics *graphics) } Graphics *const g = static_cast(graphics); - - graphics->setFont(getFont()); + gcn::Font *const font = getFont(); + graphics->setFont(font); const int selectedId = spellShortcut->getSelectedItem(); g->setColor(mForegroundColor); @@ -139,8 +141,8 @@ void SpellShortcutContainer::draw(gcn::Graphics *graphics) } } - g->drawText(spell->getSymbol(), itemX + 2, - itemY + mBoxHeight / 2, gcn::Graphics::LEFT); + font->drawString(g, spell->getSymbol(), + itemX + 2, itemY + mBoxHeight / 2); } } -- cgit v1.2.3-70-g09d2