summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrichard <none@none>2009-12-07 19:03:31 -0800
committerrichard <none@none>2009-12-07 19:03:31 -0800
commitfdf8602d5f4f5a6c5b8b566fce1bfbe0fc082d1f (patch)
tree349c05cf09f437b77e443f4b6564f16dfb73c35e
parentf96a91431036a9dfe9ef5a43901f58e8cdac2db4 (diff)
fix for inline widgets never shrinking with resizable text editor
also fixed dropping last line in chat history
-rw-r--r--indra/llui/lltextbase.cpp13
1 files 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<S32, S32> 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());
}