summaryrefslogtreecommitdiff
path: root/src/gui/widgets/avatarlistbox.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-12-27 01:22:21 +0300
committerAndrei Karas <akaras@inbox.ru>2012-12-27 23:15:05 +0300
commit2babe1d6491f5231b0e97349ccb198b92bb90ba9 (patch)
tree3db30d7bff509ec233ba91ee14f55ea95ebb159c /src/gui/widgets/avatarlistbox.cpp
parent81d317cf80f4c333396c708bbefca16be2362c8c (diff)
downloadplus-2babe1d6491f5231b0e97349ccb198b92bb90ba9.tar.gz
plus-2babe1d6491f5231b0e97349ccb198b92bb90ba9.tar.bz2
plus-2babe1d6491f5231b0e97349ccb198b92bb90ba9.tar.xz
plus-2babe1d6491f5231b0e97349ccb198b92bb90ba9.zip
Improve draw speed in listboxes.
Diffstat (limited to 'src/gui/widgets/avatarlistbox.cpp')
-rw-r--r--src/gui/widgets/avatarlistbox.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/gui/widgets/avatarlistbox.cpp b/src/gui/widgets/avatarlistbox.cpp
index 5a5027982..d9fe65dfe 100644
--- a/src/gui/widgets/avatarlistbox.cpp
+++ b/src/gui/widgets/avatarlistbox.cpp
@@ -105,13 +105,11 @@ void AvatarListBox::draw(gcn::Graphics *gcnGraphics)
Graphics *const graphics = static_cast<Graphics *const>(gcnGraphics);
mHighlightColor.a = static_cast<int>(mAlpha * 255.0f);
-// graphics->setColor(mHighlightColor);
- graphics->setFont(getFont());
+ gcn::Font *const font = getFont();
+ graphics->setFont(font);
const int fontHeight = getFont()->getHeight();
-
const gcn::Widget *const parent = mParent;
-
const std::string name = player_node->getName();
// Draw the list elements
@@ -271,9 +269,9 @@ void AvatarListBox::draw(gcn::Graphics *gcnGraphics)
// Draw Name
if (a->getType() == MapItem::SEPARATOR)
- graphics->drawText(text, mPadding, y + mPadding);
+ font->drawString(graphics, text, mPadding, y + mPadding);
else
- graphics->drawText(text, 15 + mPadding, y + mPadding);
+ font->drawString(graphics, text, 15 + mPadding, y + mPadding);
if (a->getDisplayBold())
graphics->setFont(getFont());