diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-03-27 01:40:56 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-03-27 01:41:32 +0300 |
commit | a65c9ec055e51bdff5e10334c9e692411e69fb3e (patch) | |
tree | 8362fb3b985ca6dcdd572e4b391753417db3a52d /src | |
parent | 8e62e252525a7410e6877d3d81eafc6dcbcbaf79 (diff) | |
download | manaplus-a65c9ec055e51bdff5e10334c9e692411e69fb3e.tar.gz manaplus-a65c9ec055e51bdff5e10334c9e692411e69fb3e.tar.bz2 manaplus-a65c9ec055e51bdff5e10334c9e692411e69fb3e.tar.xz manaplus-a65c9ec055e51bdff5e10334c9e692411e69fb3e.zip |
Fix chat item links. Some times links worked incorrectly.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/widgets/browserbox.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp index d5b088369..8e8d4f2c2 100644 --- a/src/gui/widgets/browserbox.cpp +++ b/src/gui/widgets/browserbox.cpp @@ -175,13 +175,17 @@ void BrowserBox::addRow(const std::string &row, bool atTop) while (mTextRows.size() > mMaxRows) { mTextRows.pop_front(); - for (unsigned int i = 0; i < mLinks.size(); i++) + LinkIterator it = mLinks.begin(); + LinkIterator it_end = mLinks.end(); + while (it != it_end) { - mLinks[i].y1 -= font->getHeight(); - mLinks[i].y2 -= font->getHeight(); + (*it).y1 -= font->getHeight(); + (*it).y2 -= font->getHeight(); - if (mLinks[i].y1 < 0) - mLinks.erase(mLinks.begin() + i); + if ((*it).y1 < 0) + it = mLinks.erase(it); + else + ++ it; } } } |