From 6efbbfa0805c337b3f7e476fd743a964bc68d09e Mon Sep 17 00:00:00 2001
From: Yuri Chebotarev <ychebotarev@productengine.com>
Date: Mon, 22 Mar 2010 15:35:34 +0200
Subject: fix for EXT-4288 Shrinking chat history window from top doesn't keep
 scroll thumb at bottom

--HG--
branch : product-engine
---
 indra/llui/lltextbase.cpp | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 851fb966ec..d7bbb8a56e 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -957,7 +957,18 @@ void LLTextBase::reshape(S32 width, S32 height, BOOL called_from_parent)
 {
 	if (width != getRect().getWidth() || height != getRect().getHeight())
 	{
+		//EXT-4288
+		//to keep consistance scrolling behaviour 
+		//when scrolling from top and from bottom...
+		bool is_scrolled_to_end = (mScroller!=NULL) && scrolledToEnd();
+		
 		LLUICtrl::reshape( width, height, called_from_parent );
+	
+		if (is_scrolled_to_end)
+		{
+			deselect();
+			endOfDoc();
+		}		
 
 		// do this first after reshape, because other things depend on
 		// up-to-date mVisibleTextRect
-- 
cgit v1.2.3