From 6059f17f7a03d62c2875c921d501587dbc2253c7 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 27 Mar 2012 02:10:26 +0300 Subject: Fix chat links again. --- src/gui/widgets/browserbox.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'src/gui/widgets/browserbox.cpp') 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); -- cgit v1.2.3-60-g2f50