diff options
| author | Rick Pasetto <rick@lindenlab.com> | 2009-11-25 09:54:19 -0800 |
|---|---|---|
| committer | Rick Pasetto <rick@lindenlab.com> | 2009-11-25 09:54:19 -0800 |
| commit | 05ae52a37f9f4d2519c40fe38f1b7143270c46ee (patch) | |
| tree | ba3ea89cda34343550a909700f53ab18043a5d4a /indra/llui/lltextbase.cpp | |
| parent | e2e7d544b6a114e70e3b46f516a4f0e8d7db4bd1 (diff) | |
| parent | 46b36d4fde4de97cd9960553ea77a64fbbe34b6a (diff) | |
merge
Diffstat (limited to 'indra/llui/lltextbase.cpp')
| -rw-r--r-- | indra/llui/lltextbase.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index e210667764..7bf10d774c 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -60,6 +60,11 @@ LLTextBase::line_info::line_info(S32 index_start, S32 index_end, LLRect rect, S3 bool LLTextBase::compare_segment_end::operator()(const LLTextSegmentPtr& a, const LLTextSegmentPtr& b) const { + // sort empty spans (e.g. 11-11) after previous non-empty spans (e.g. 5-11) + if (a->getEnd() == b->getEnd()) + { + return a->getStart() < b->getStart(); + } return a->getEnd() < b->getEnd(); } @@ -2060,16 +2065,16 @@ void LLTextBase::updateRects() mContentsRect.unionWith(line_iter->mRect); } - mContentsRect.mLeft = 0; + S32 delta_pos_x = -mContentsRect.mLeft; mContentsRect.mTop += mVPad; S32 delta_pos = -mContentsRect.mBottom; // move line segments to fit new document rect for (line_list_t::iterator it = mLineInfoList.begin(); it != mLineInfoList.end(); ++it) { - it->mRect.translate(0, delta_pos); + it->mRect.translate(delta_pos_x, delta_pos); } - mContentsRect.translate(0, delta_pos); + mContentsRect.translate(delta_pos_x, delta_pos); } // update document container dimensions according to text contents |
