summaryrefslogtreecommitdiff
path: root/indra/llui/lltexteditor.cpp
diff options
context:
space:
mode:
authorJames Cook <james@lindenlab.com>2008-07-18 17:50:25 +0000
committerJames Cook <james@lindenlab.com>2008-07-18 17:50:25 +0000
commited386ae547c225e352c39e8d14921572ee534b0b (patch)
treef67ff767edfc07900c0c8c16cd4439eb38d05be0 /indra/llui/lltexteditor.cpp
parent292627c09df6085c985a189edd5df06d3ca1eb47 (diff)
merge support-featurettes-snapshot-merge-2 for QAR-754, includes:
* featurettes-4 89061:89589 (which is all of featurettes-1, -2, and -3, and part of -4) * gteam-showstoppers-3 91950:91951 (which is all of gteam-showstoppers-1, -2, and -3) * featurettes-5 92149:92150 (patch for last line of chat text not visible in chat history, DEV-17771) * snapshot-3 91988:91991 (which is all of snapshot-1, -2, and -3) Merging revisions 92190-92387 of svn+ssh://svn.lindenlab.com/svn/linden/branches/support-featurettes-snapshot-merge-2 into release, respecting ancestry * QAR-590 Merge Lock Request for Support Sprint * QAR-627 Merge snapshot improvements * QAR-686 Merge Lock request for Featurettes
Diffstat (limited to 'indra/llui/lltexteditor.cpp')
-rw-r--r--indra/llui/lltexteditor.cpp35
1 files changed, 27 insertions, 8 deletions
diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp
index a2063358bd..b70ad4c53c 100644
--- a/indra/llui/lltexteditor.cpp
+++ b/indra/llui/lltexteditor.cpp
@@ -257,6 +257,7 @@ LLTextEditor::LLTextEditor(
mIsSelecting( FALSE ),
mSelectionStart( 0 ),
mSelectionEnd( 0 ),
+ mScrolledToBottom( FALSE ),
mOnScrollEndCallback( NULL ),
mOnScrollEndData( NULL ),
mCursorColor( LLUI::sColorsGroup->getColor( "TextCursorColor" ) ),
@@ -3361,20 +3362,26 @@ void LLTextEditor::reshape(S32 width, S32 height, BOOL called_from_parent)
{
LLView::reshape( width, height, called_from_parent );
- // if scrolled to bottom, stay at bottom
- // unless user is editing text
- if (mScrolledToBottom && mTrackBottom && !hasFocus())
- {
- endOfDoc();
- }
-
+ // do this first after reshape, because other things depend on
+ // up-to-date mTextRect
updateTextRect();
+
+ updateLineStartList();
+
+ // propagate shape information to scrollbar
+ mScrollbar->setDocSize( getLineCount() );
S32 line_height = llround( mGLFont->getLineHeight() );
S32 page_lines = mTextRect.getHeight() / line_height;
mScrollbar->setPageSize( page_lines );
- updateLineStartList();
+ // if scrolled to bottom, stay at bottom
+ // unless user is editing text
+ // do this after updating page size
+ if (mScrolledToBottom && mTrackBottom && !hasFocus())
+ {
+ endOfDoc();
+ }
}
void LLTextEditor::autoIndent()
@@ -3540,6 +3547,10 @@ void LLTextEditor::appendText(const std::string &new_text, bool allow_undo, bool
{
mSelectionStart = selection_start;
mSelectionEnd = selection_end;
+
+
+
+
mIsSelecting = was_selecting;
setCursorPos(cursor_pos);
}
@@ -3556,6 +3567,14 @@ void LLTextEditor::appendText(const std::string &new_text, bool allow_undo, bool
{
blockUndo();
}
+
+ // if scrolled to bottom, stay at bottom
+ // unless user is editing text
+ // do this after updating page size
+ if (mScrolledToBottom && mTrackBottom && !hasFocus())
+ {
+ endOfDoc();
+ }
}
void LLTextEditor::removeTextFromEnd(S32 num_chars)