diff options
author | Blue <bluesansdouze@gmail.com> | 2009-05-13 20:35:44 +0200 |
---|---|---|
committer | Blue <bluesansdouze@gmail.com> | 2009-05-13 20:35:44 +0200 |
commit | 22685431a23b05d66af28abda488d0891b1c0a34 (patch) | |
tree | a207b9230833abbed3da751ca7e3c4ccdc8e9783 /src/gui/widgets/browserbox.cpp | |
parent | 9071a692116745f2cafd8556cbff28095910730e (diff) | |
parent | b5ad7e490f0f429a5abac2acae48ecf25485256f (diff) | |
download | mana-client-22685431a23b05d66af28abda488d0891b1c0a34.tar.gz mana-client-22685431a23b05d66af28abda488d0891b1c0a34.tar.bz2 mana-client-22685431a23b05d66af28abda488d0891b1c0a34.tar.xz mana-client-22685431a23b05d66af28abda488d0891b1c0a34.zip |
Merge branch 'master' of git@gitorious.org:tmw/mainline
Diffstat (limited to 'src/gui/widgets/browserbox.cpp')
-rw-r--r-- | src/gui/widgets/browserbox.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp index 52b9bfa6..a03d53eb 100644 --- a/src/gui/widgets/browserbox.cpp +++ b/src/gui/widgets/browserbox.cpp @@ -23,9 +23,9 @@ #include "gui/linkhandler.h" #include "gui/palette.h" -#include "gui/truetypefont.h" #include <guichan/graphics.hpp> +#include <guichan/font.hpp> #include <algorithm> @@ -71,7 +71,7 @@ void BrowserBox::addRow(const std::string &row) std::string newRow; BROWSER_LINK bLink; std::string::size_type idx1, idx2, idx3; - TrueTypeFont *font = static_cast<TrueTypeFont*>(getFont()); + gcn::Font *font = getFont(); // Use links and user defined colors if (mUseLinksAndUserColors) @@ -116,7 +116,6 @@ void BrowserBox::addRow(const std::string &row) newRow += tmp; } - // Don't use links and user defined colors else { @@ -281,7 +280,7 @@ void BrowserBox::draw(gcn::Graphics *graphics) int x = 0, y = 0; int wrappedLines = 0; int link = 0; - TrueTypeFont *font = static_cast<TrueTypeFont*>(getFont()); + gcn::Font *font = getFont(); graphics->setColor(guiPalette->getColor(Palette::TEXT)); for (TextRowIterator i = mTextRows.begin(); i != mTextRows.end(); i++) @@ -296,10 +295,11 @@ void BrowserBox::draw(gcn::Graphics *graphics) // Check for separator lines if (row.find("---", 0) == 0) { + const int dashWidth = font->getWidth("-"); for (x = 0; x < getWidth(); x++) { font->drawString(graphics, "-", x, y); - x += font->getWidth("-") - 2; + x += dashWidth - 2; } y += font->getHeight(); continue; @@ -389,7 +389,7 @@ void BrowserBox::draw(gcn::Graphics *graphics) { bool forced = false; char const *hyphen = "~"; - int hyphenWidth = font->getWidth(hyphen); + int hyphenWidth = font->getWidth(hyphen); /* FIXME: This code layout makes it easy to crash remote clients by talking garbage. Forged long utf-8 characters |