aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llui/llscrollbar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llui/llscrollbar.cpp')
-rw-r--r--linden/indra/llui/llscrollbar.cpp48
1 files changed, 34 insertions, 14 deletions
diff --git a/linden/indra/llui/llscrollbar.cpp b/linden/indra/llui/llscrollbar.cpp
index 34acf03..ec46551 100644
--- a/linden/indra/llui/llscrollbar.cpp
+++ b/linden/indra/llui/llscrollbar.cpp
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
@@ -159,30 +159,50 @@ void LLScrollbar::setDocParams( S32 size, S32 pos )
159 159
160void LLScrollbar::setDocPos(S32 pos) 160void LLScrollbar::setDocPos(S32 pos)
161{ 161{
162 mDocPos = llclamp( pos, 0, getDocPosMax() ); 162 if (pos != mDocPos)
163 mDocChanged = TRUE; 163 {
164 mDocPos = llclamp( pos, 0, getDocPosMax() );
165 mDocChanged = TRUE;
164 166
165 updateThumbRect(); 167 updateThumbRect();
168 }
166} 169}
167 170
168void LLScrollbar::setDocSize(S32 size) 171void LLScrollbar::setDocSize(S32 size)
169{ 172{
170 mDocSize = size; 173 if (size != mDocSize)
171 mDocPos = llclamp( mDocPos, 0, getDocPosMax() ); 174 {
172 mDocChanged = TRUE; 175 mDocSize = size;
176 mDocPos = llclamp( mDocPos, 0, getDocPosMax() );
177 mDocChanged = TRUE;
173 178
174 updateThumbRect(); 179 updateThumbRect();
180 }
175} 181}
176 182
177void LLScrollbar::setPageSize( S32 page_size ) 183void LLScrollbar::setPageSize( S32 page_size )
178{ 184{
179 mPageSize = page_size; 185 if (page_size != mPageSize)
180 mDocPos = llclamp( mDocPos, 0, getDocPosMax() ); 186 {
181 mDocChanged = TRUE; 187 mPageSize = page_size;
188 mDocPos = llclamp( mDocPos, 0, getDocPosMax() );
189 mDocChanged = TRUE;
182 190
183 updateThumbRect(); 191 updateThumbRect();
192 }
193}
194
195BOOL LLScrollbar::isAtBeginning()
196{
197 return mDocPos == 0;
198}
199
200BOOL LLScrollbar::isAtEnd()
201{
202 return mDocPos == getDocPosMax();
184} 203}
185 204
205
186void LLScrollbar::updateThumbRect() 206void LLScrollbar::updateThumbRect()
187{ 207{
188// llassert( 0 <= mDocSize ); 208// llassert( 0 <= mDocSize );
@@ -479,7 +499,7 @@ void LLScrollbar::draw()
479 // Draw background and thumb. 499 // Draw background and thumb.
480 LLUUID rounded_rect_image_id; 500 LLUUID rounded_rect_image_id;
481 rounded_rect_image_id.set(LLUI::sAssetsGroup->getString("rounded_square.tga")); 501 rounded_rect_image_id.set(LLUI::sAssetsGroup->getString("rounded_square.tga"));
482 LLImageGL* rounded_rect_imagep = LLUI::sImageProvider->getUIImageByID(rounded_rect_image_id); 502 LLImageGL* rounded_rect_imagep = LLUI::sImageProvider->getImageByID(rounded_rect_image_id);
483 503
484 if (!rounded_rect_imagep) 504 if (!rounded_rect_imagep)
485 { 505 {