diff options
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); } |