diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-09-15 23:05:16 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-09-15 23:05:16 +0300 |
commit | b162094c7609fa37f2eef6be3fed0e26830bc506 (patch) | |
tree | 072b83f0ce6b7f871acd9a2d2c6c49b8dac7dc64 /src/gui/widgets/textpreview.cpp | |
parent | 4031a5068859fb99f604dfecceb2fb1c954e166f (diff) | |
download | manaplus-b162094c7609fa37f2eef6be3fed0e26830bc506.tar.gz manaplus-b162094c7609fa37f2eef6be3fed0e26830bc506.tar.bz2 manaplus-b162094c7609fa37f2eef6be3fed0e26830bc506.tar.xz manaplus-b162094c7609fa37f2eef6be3fed0e26830bc506.zip |
Improve a bit widgets speed.
Diffstat (limited to 'src/gui/widgets/textpreview.cpp')
-rw-r--r-- | src/gui/widgets/textpreview.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/gui/widgets/textpreview.cpp b/src/gui/widgets/textpreview.cpp index 43b81b2ce..ab5a8ce28 100644 --- a/src/gui/widgets/textpreview.cpp +++ b/src/gui/widgets/textpreview.cpp @@ -54,10 +54,7 @@ void TextPreview::draw(gcn::Graphics* graphics) if (Client::getGuiAlpha() != mAlpha) mAlpha = Client::getGuiAlpha(); - int alpha = static_cast<int>(mAlpha * 255.0f); - - if (!mTextAlpha) - alpha = 255; + const int alpha = mTextAlpha ? static_cast<int>(mAlpha * 255.0f) : 255; if (mOpaque) { @@ -82,8 +79,7 @@ void TextPreview::draw(gcn::Graphics* graphics) graphics->fillRectangle(gcn::Rectangle(1, 1, x, y)); } - TextRenderer::renderText(graphics, mText, 2, 2, gcn::Graphics::LEFT, - gcn::Color(mTextColor->r, mTextColor->g, - mTextColor->b, alpha), - mFont, mOutline, mShadow); + TextRenderer::renderText(graphics, mText, 2, 2, gcn::Graphics::LEFT, + gcn::Color(mTextColor->r, mTextColor->g, mTextColor->b, alpha), + mFont, mOutline, mShadow); } |