diff options
| author | Steven Bennetts <steve@lindenlab.com> | 2007-03-16 20:39:40 +0000 |
|---|---|---|
| committer | Steven Bennetts <steve@lindenlab.com> | 2007-03-16 20:39:40 +0000 |
| commit | 5e9e67cb2d1d3dfc82dfe96103270b2341991ddd (patch) | |
| tree | 2df2a064523b2bffef6ff7566399c76b1f2cc196 /indra/llui/llscrollbar.cpp | |
| parent | 1ada34fc0c5dc20bffba231ef513b569dbec32ea (diff) | |
merge -r 59028:59178 maintenance -> release.
Diffstat (limited to 'indra/llui/llscrollbar.cpp')
| -rw-r--r-- | indra/llui/llscrollbar.cpp | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/indra/llui/llscrollbar.cpp b/indra/llui/llscrollbar.cpp index 4a5ae1dadf..c21bbdcc75 100644 --- a/indra/llui/llscrollbar.cpp +++ b/indra/llui/llscrollbar.cpp @@ -386,21 +386,23 @@ BOOL LLScrollbar::handleScrollWheel(S32 x, S32 y, S32 clicks) BOOL LLScrollbar::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *carge_data, EAcceptance *accept, LLString &tooltip_msg) { - if (!drop) - { - //TODO: refactor this - S32 variable_lines = getDocPosMax(); - S32 pos = (VERTICAL == mOrientation) ? y : x; - S32 thumb_length = (VERTICAL == mOrientation) ? mThumbRect.getHeight() : mThumbRect.getWidth(); - S32 thumb_track_length = (VERTICAL == mOrientation) ? (mRect.getHeight() - 2 * SCROLLBAR_SIZE) : (mRect.getWidth() - 2 * SCROLLBAR_SIZE); - S32 usable_track_length = thumb_track_length - thumb_length; - F32 ratio = (VERTICAL == mOrientation) ? F32(pos - SCROLLBAR_SIZE - thumb_length) / usable_track_length - : F32(pos - SCROLLBAR_SIZE) / usable_track_length; - S32 new_pos = (VERTICAL == mOrientation) ? llclamp( S32(variable_lines - ratio * variable_lines + 0.5f), 0, variable_lines ) - : llclamp( S32(ratio * variable_lines + 0.5f), 0, variable_lines ); - changeLine( new_pos - mDocPos, TRUE ); - } - return TRUE; + // enable this to get drag and drop to control scrollbars + //if (!drop) + //{ + // //TODO: refactor this + // S32 variable_lines = getDocPosMax(); + // S32 pos = (VERTICAL == mOrientation) ? y : x; + // S32 thumb_length = (VERTICAL == mOrientation) ? mThumbRect.getHeight() : mThumbRect.getWidth(); + // S32 thumb_track_length = (VERTICAL == mOrientation) ? (mRect.getHeight() - 2 * SCROLLBAR_SIZE) : (mRect.getWidth() - 2 * SCROLLBAR_SIZE); + // S32 usable_track_length = thumb_track_length - thumb_length; + // F32 ratio = (VERTICAL == mOrientation) ? F32(pos - SCROLLBAR_SIZE - thumb_length) / usable_track_length + // : F32(pos - SCROLLBAR_SIZE) / usable_track_length; + // S32 new_pos = (VERTICAL == mOrientation) ? llclamp( S32(variable_lines - ratio * variable_lines + 0.5f), 0, variable_lines ) + // : llclamp( S32(ratio * variable_lines + 0.5f), 0, variable_lines ); + // changeLine( new_pos - mDocPos, TRUE ); + //} + //return TRUE; + return FALSE; } BOOL LLScrollbar::handleMouseUp(S32 x, S32 y, MASK mask) |
