summaryrefslogtreecommitdiff
path: root/src/gui/widgets/textpreview.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-02-16 22:17:22 +0300
committerAndrei Karas <akaras@inbox.ru>2014-02-16 22:17:22 +0300
commit6e6c5b2ba399e0ed364ada843c4c759ee54de219 (patch)
tree562e6a840c856ba8c4d35c6806020289c65d54d2 /src/gui/widgets/textpreview.cpp
parent82ac4641828ec7387863bb18cf4493190c4cc68f (diff)
downloadmanaverse-6e6c5b2ba399e0ed364ada843c4c759ee54de219.tar.gz
manaverse-6e6c5b2ba399e0ed364ada843c4c759ee54de219.tar.bz2
manaverse-6e6c5b2ba399e0ed364ada843c4c759ee54de219.tar.xz
manaverse-6e6c5b2ba399e0ed364ada843c4c759ee54de219.zip
combine font classes in one.
Diffstat (limited to 'src/gui/widgets/textpreview.cpp')
-rw-r--r--src/gui/widgets/textpreview.cpp9
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),