diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-02-16 22:17:22 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-02-16 22:17:22 +0300 |
commit | 6e6c5b2ba399e0ed364ada843c4c759ee54de219 (patch) | |
tree | 562e6a840c856ba8c4d35c6806020289c65d54d2 /src/gui/widgets/textpreview.cpp | |
parent | 82ac4641828ec7387863bb18cf4493190c4cc68f (diff) | |
download | mv-6e6c5b2ba399e0ed364ada843c4c759ee54de219.tar.gz mv-6e6c5b2ba399e0ed364ada843c4c759ee54de219.tar.bz2 mv-6e6c5b2ba399e0ed364ada843c4c759ee54de219.tar.xz mv-6e6c5b2ba399e0ed364ada843c4c759ee54de219.zip |
combine font classes in one.
Diffstat (limited to 'src/gui/widgets/textpreview.cpp')
-rw-r--r-- | src/gui/widgets/textpreview.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/gui/widgets/textpreview.cpp b/src/gui/widgets/textpreview.cpp index 5ef553b3c..2caf2e44c 100644 --- a/src/gui/widgets/textpreview.cpp +++ b/src/gui/widgets/textpreview.cpp @@ -24,8 +24,8 @@ #include "client.h" +#include "gui/font.h" #include "gui/gui.h" -#include "gui/sdlfont.h" #include "debug.h" @@ -100,12 +100,11 @@ void TextPreview::draw(Graphics* graphics) if (mTextBGColor) { - const SDLFont *const font = dynamic_cast<SDLFont*>(mFont); - if (font) + if (mFont) { - const int x = font->getWidth(mText) + 1 + const int x = mFont->getWidth(mText) + 1 + 2 * ((mOutline || mShadow) ? 1 :0); - const int y = font->getHeight() + 1 + const int y = mFont->getHeight() + 1 + 2 * ((mOutline || mShadow) ? 1 : 0); graphics->setColor(gcn::Color(static_cast<int>(mTextBGColor->r), static_cast<int>(mTextBGColor->g), |