diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-12-27 01:22:21 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-12-27 23:15:05 +0300 |
commit | 2babe1d6491f5231b0e97349ccb198b92bb90ba9 (patch) | |
tree | 3db30d7bff509ec233ba91ee14f55ea95ebb159c /src/gui/widgets/avatarlistbox.cpp | |
parent | 81d317cf80f4c333396c708bbefca16be2362c8c (diff) | |
download | manaverse-2babe1d6491f5231b0e97349ccb198b92bb90ba9.tar.gz manaverse-2babe1d6491f5231b0e97349ccb198b92bb90ba9.tar.bz2 manaverse-2babe1d6491f5231b0e97349ccb198b92bb90ba9.tar.xz manaverse-2babe1d6491f5231b0e97349ccb198b92bb90ba9.zip |
Improve draw speed in listboxes.
Diffstat (limited to 'src/gui/widgets/avatarlistbox.cpp')
-rw-r--r-- | src/gui/widgets/avatarlistbox.cpp | 10 |
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()); |