diff options
author | Jacek Antonelli | 2008-08-15 23:44:50 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:50 -0500 |
commit | 89fe5dab825a62a0e3fd8d248cbc91c65eb2a426 (patch) | |
tree | bcff14b7888d04a2fec799c59369f6095224bd08 /linden/indra/llui/llscrollbar.cpp | |
parent | Second Life viewer sources 1.13.3.2 (diff) | |
download | meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.zip meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.gz meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.bz2 meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.xz |
Second Life viewer sources 1.14.0.0
Diffstat (limited to 'linden/indra/llui/llscrollbar.cpp')
-rw-r--r-- | linden/indra/llui/llscrollbar.cpp | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/linden/indra/llui/llscrollbar.cpp b/linden/indra/llui/llscrollbar.cpp index da3e472..578fdb1 100644 --- a/linden/indra/llui/llscrollbar.cpp +++ b/linden/indra/llui/llscrollbar.cpp | |||
@@ -405,21 +405,23 @@ BOOL LLScrollbar::handleScrollWheel(S32 x, S32 y, S32 clicks) | |||
405 | BOOL LLScrollbar::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, | 405 | BOOL LLScrollbar::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, |
406 | EDragAndDropType cargo_type, void *carge_data, EAcceptance *accept, LLString &tooltip_msg) | 406 | EDragAndDropType cargo_type, void *carge_data, EAcceptance *accept, LLString &tooltip_msg) |
407 | { | 407 | { |
408 | if (!drop) | 408 | // enable this to get drag and drop to control scrollbars |
409 | { | 409 | //if (!drop) |
410 | //TODO: refactor this | 410 | //{ |
411 | S32 variable_lines = getDocPosMax(); | 411 | // //TODO: refactor this |
412 | S32 pos = (VERTICAL == mOrientation) ? y : x; | 412 | // S32 variable_lines = getDocPosMax(); |
413 | S32 thumb_length = (VERTICAL == mOrientation) ? mThumbRect.getHeight() : mThumbRect.getWidth(); | 413 | // S32 pos = (VERTICAL == mOrientation) ? y : x; |
414 | S32 thumb_track_length = (VERTICAL == mOrientation) ? (mRect.getHeight() - 2 * SCROLLBAR_SIZE) : (mRect.getWidth() - 2 * SCROLLBAR_SIZE); | 414 | // S32 thumb_length = (VERTICAL == mOrientation) ? mThumbRect.getHeight() : mThumbRect.getWidth(); |
415 | S32 usable_track_length = thumb_track_length - thumb_length; | 415 | // S32 thumb_track_length = (VERTICAL == mOrientation) ? (mRect.getHeight() - 2 * SCROLLBAR_SIZE) : (mRect.getWidth() - 2 * SCROLLBAR_SIZE); |
416 | F32 ratio = (VERTICAL == mOrientation) ? F32(pos - SCROLLBAR_SIZE - thumb_length) / usable_track_length | 416 | // S32 usable_track_length = thumb_track_length - thumb_length; |
417 | : F32(pos - SCROLLBAR_SIZE) / usable_track_length; | 417 | // F32 ratio = (VERTICAL == mOrientation) ? F32(pos - SCROLLBAR_SIZE - thumb_length) / usable_track_length |
418 | S32 new_pos = (VERTICAL == mOrientation) ? llclamp( S32(variable_lines - ratio * variable_lines + 0.5f), 0, variable_lines ) | 418 | // : F32(pos - SCROLLBAR_SIZE) / usable_track_length; |
419 | : llclamp( S32(ratio * variable_lines + 0.5f), 0, variable_lines ); | 419 | // S32 new_pos = (VERTICAL == mOrientation) ? llclamp( S32(variable_lines - ratio * variable_lines + 0.5f), 0, variable_lines ) |
420 | changeLine( new_pos - mDocPos, TRUE ); | 420 | // : llclamp( S32(ratio * variable_lines + 0.5f), 0, variable_lines ); |
421 | } | 421 | // changeLine( new_pos - mDocPos, TRUE ); |
422 | return TRUE; | 422 | //} |
423 | //return TRUE; | ||
424 | return FALSE; | ||
423 | } | 425 | } |
424 | 426 | ||
425 | BOOL LLScrollbar::handleMouseUp(S32 x, S32 y, MASK mask) | 427 | BOOL LLScrollbar::handleMouseUp(S32 x, S32 y, MASK mask) |