From fdf8602d5f4f5a6c5b8b566fce1bfbe0fc082d1f Mon Sep 17 00:00:00 2001 From: richard Date: Mon, 7 Dec 2009 19:03:31 -0800 Subject: fix for inline widgets never shrinking with resizable text editor also fixed dropping last line in chat history --- indra/llui/lltextbase.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index c1b3b8b2a7..e0750968ae 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -194,7 +194,7 @@ LLTextBase::LLTextBase(const LLTextBase::Params &p) mHAlign(p.font_halign), mLineSpacingMult(p.line_spacing.multiple), mLineSpacingPixels(p.line_spacing.pixels), - mClipPartial(p.clip_partial), + mClipPartial(p.clip_partial && !p.allow_scroll), mTrackEnd( p.track_end ), mScrollIndex(-1), mSelectionStart( 0 ), @@ -529,11 +529,6 @@ void LLTextBase::drawText() S32 next_line = cur_line + 1; line_info& line = mLineInfoList[cur_line]; - if ((line.mRect.mTop - scrolled_view_rect.mBottom) < mTextRect.mBottom) - { - break; - } - S32 next_start = -1; S32 line_end = text_len; @@ -1078,6 +1073,10 @@ void LLTextBase::reflow(S32 start_index) { mReflowNeeded = FALSE; + // shrink document to minimum size (visible portion of text widget) + // to force inlined widgets with follows set to shrink + mDocumentView->setShape(mTextRect); + bool scrolled_to_bottom = mScroller ? mScroller->isAtBottom() : false; LLRect old_cursor_rect = getLocalRectFromDocIndex(mCursorPos); @@ -1340,13 +1339,11 @@ std::pair LLTextBase::getVisibleLines(bool fully_visible) if (fully_visible) { - // binary search for line that starts before top of visible buffer and starts before end of visible buffer first_iter = std::lower_bound(mLineInfoList.begin(), mLineInfoList.end(), visible_region.mTop, compare_top()); last_iter = std::lower_bound(mLineInfoList.begin(), mLineInfoList.end(), visible_region.mBottom, compare_bottom()); } else { - // binary search for line that starts before top of visible buffer and starts before end of visible buffer first_iter = std::lower_bound(mLineInfoList.begin(), mLineInfoList.end(), visible_region.mTop, compare_bottom()); last_iter = std::lower_bound(mLineInfoList.begin(), mLineInfoList.end(), visible_region.mBottom, compare_top()); } -- cgit v1.2.3