summaryrefslogtreecommitdiff
path: root/src/gui/widgets/textpreview.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-02-07 16:18:13 +0300
committerAndrei Karas <akaras@inbox.ru>2016-02-07 16:18:13 +0300
commit9fe21fcd8883b37bdc30224822e6e42afb35b8f0 (patch)
tree798117abd4dc7e610997d59d530a96ddc1509f53 /src/gui/widgets/textpreview.cpp
parent4429cb14e9e187edef27aba692a4266733f79c17 (diff)
downloadmanaplus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.gz
manaplus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.bz2
manaplus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.xz
manaplus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.zip
Replace most static_cast<Type> to shorter versions from defines.
Diffstat (limited to 'src/gui/widgets/textpreview.cpp')
-rw-r--r--src/gui/widgets/textpreview.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/gui/widgets/textpreview.cpp b/src/gui/widgets/textpreview.cpp
index a0b504065..6e61a16a5 100644
--- a/src/gui/widgets/textpreview.cpp
+++ b/src/gui/widgets/textpreview.cpp
@@ -88,15 +88,15 @@ void TextPreview::draw(Graphics* graphics)
if (settings.guiAlpha != mAlpha)
mAlpha = settings.guiAlpha;
- const int intAlpha = static_cast<int>(mAlpha * 255.0F);
+ const int intAlpha = CAST_S32(mAlpha * 255.0F);
const int alpha = mTextAlpha ? intAlpha : 255;
if (mOpaque)
{
- graphics->setColor(Color(static_cast<int>(mBGColor->r),
- static_cast<int>(mBGColor->g),
- static_cast<int>(mBGColor->b),
- static_cast<int>(mAlpha * 255.0F)));
+ graphics->setColor(Color(CAST_S32(mBGColor->r),
+ CAST_S32(mBGColor->g),
+ CAST_S32(mBGColor->b),
+ CAST_S32(mAlpha * 255.0F)));
graphics->fillRectangle(Rect(0, 0,
mDimension.width, mDimension.height));
}
@@ -107,9 +107,9 @@ void TextPreview::draw(Graphics* graphics)
+ 2 * ((mOutline || mShadow) ? 1 :0);
const int y = mFont->getHeight() + 1
+ 2 * ((mOutline || mShadow) ? 1 : 0);
- graphics->setColor(Color(static_cast<int>(mTextBGColor->r),
- static_cast<int>(mTextBGColor->g),
- static_cast<int>(mTextBGColor->b),
+ graphics->setColor(Color(CAST_S32(mTextBGColor->r),
+ CAST_S32(mTextBGColor->g),
+ CAST_S32(mTextBGColor->b),
intAlpha));
graphics->fillRectangle(Rect(mPadding, mPadding, x, y));
}