summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-03-27 02:10:26 +0300
committerAndrei Karas <akaras@inbox.ru>2012-03-27 02:10:26 +0300
commit6059f17f7a03d62c2875c921d501587dbc2253c7 (patch)
tree0fbca0887d7f64b6488182e3109087d5ea8c0ede /src
parenta65c9ec055e51bdff5e10334c9e692411e69fb3e (diff)
downloadManaVerse-6059f17f7a03d62c2875c921d501587dbc2253c7.tar.gz
ManaVerse-6059f17f7a03d62c2875c921d501587dbc2253c7.tar.bz2
ManaVerse-6059f17f7a03d62c2875c921d501587dbc2253c7.tar.xz
ManaVerse-6059f17f7a03d62c2875c921d501587dbc2253c7.zip
Fix chat links again.
Diffstat (limited to 'src')
-rw-r--r--src/gui/widgets/browserbox.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp
index 8e8d4f2c2..5ef7adfcd 100644
--- a/src/gui/widgets/browserbox.cpp
+++ b/src/gui/widgets/browserbox.cpp
@@ -175,12 +175,30 @@ void BrowserBox::addRow(const std::string &row, bool atTop)
while (mTextRows.size() > mMaxRows)
{
mTextRows.pop_front();
+
+ int yStart = 0;
+
+ LinePartIterator i = mLineParts.begin();
+ if (i != mLineParts.end())
+ {
+ ++ i;
+ for (; i != mLineParts.end(); ++ i)
+ {
+ const LinePart &part = *i;
+ if (!part.mX)
+ {
+ yStart = part.mY;
+ break;
+ }
+ }
+ }
+
LinkIterator it = mLinks.begin();
LinkIterator it_end = mLinks.end();
while (it != it_end)
{
- (*it).y1 -= font->getHeight();
- (*it).y2 -= font->getHeight();
+ (*it).y1 -= yStart;
+ (*it).y2 -= yStart;
if ((*it).y1 < 0)
it = mLinks.erase(it);