summaryrefslogtreecommitdiff
path: root/indra/llui/llscrollbar.cpp
diff options
context:
space:
mode:
authorRichard Nelson <richard@lindenlab.com>2009-10-21 21:30:40 +0000
committerRichard Nelson <richard@lindenlab.com>2009-10-21 21:30:40 +0000
commitb3d1eb82fadbf3a098abb49d2ef23cade4c6fe95 (patch)
tree60c0e7fc7897bb9594050262987200027f99cf58 /indra/llui/llscrollbar.cpp
parenta1770db93600d44fff9d0fa6d9637236a01ba352 (diff)
fix for chat history layout bugs
EXT-1728 - there is no new line in the text copied on junction of 2 panels EXT-1670 - fix chat history use of widgets reviewed by James
Diffstat (limited to 'indra/llui/llscrollbar.cpp')
-rw-r--r--indra/llui/llscrollbar.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/indra/llui/llscrollbar.cpp b/indra/llui/llscrollbar.cpp
index 0d674528dc..dfd315d451 100644
--- a/indra/llui/llscrollbar.cpp
+++ b/indra/llui/llscrollbar.cpp
@@ -149,7 +149,8 @@ void LLScrollbar::setDocParams( S32 size, S32 pos )
updateThumbRect();
}
-void LLScrollbar::setDocPos(S32 pos, BOOL update_thumb)
+// returns true if document position really changed
+bool LLScrollbar::setDocPos(S32 pos, BOOL update_thumb)
{
pos = llclamp(pos, 0, getDocPosMax());
if (pos != mDocPos)
@@ -166,7 +167,9 @@ void LLScrollbar::setDocPos(S32 pos, BOOL update_thumb)
{
updateThumbRect();
}
+ return true;
}
+ return false;
}
void LLScrollbar::setDocSize(S32 size)
@@ -409,13 +412,8 @@ BOOL LLScrollbar::handleHover(S32 x, S32 y, MASK mask)
BOOL LLScrollbar::handleScrollWheel(S32 x, S32 y, S32 clicks)
{
- S32 pos = llclamp(mDocPos + clicks * mStepSize, 0, getDocPosMax());
- if (pos != mDocPos)
- {
- setDocPos(pos, TRUE);
- return TRUE;
- }
- return FALSE;
+ BOOL handled = changeLine( clicks * mStepSize, TRUE );
+ return handled;
}
BOOL LLScrollbar::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
@@ -578,9 +576,9 @@ void LLScrollbar::draw()
} // end draw
-void LLScrollbar::changeLine( S32 delta, BOOL update_thumb )
+bool LLScrollbar::changeLine( S32 delta, BOOL update_thumb )
{
- setDocPos(mDocPos + delta, update_thumb);
+ return setDocPos(mDocPos + delta, update_thumb);
}
void LLScrollbar::setValue(const LLSD& value)