From 36fccc3888c5dc318a8a235da8a5cae4faeb637d Mon Sep 17 00:00:00 2001 From: James Cook Date: Wed, 30 Apr 2008 23:30:09 +0000 Subject: svn merge -r 86190:86191 maint-ui-11-merge (EFFECTIVE MERGE: -r 84579:85724 maint-ui-11-qa). --- indra/llui/llresizebar.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'indra/llui/llresizebar.cpp') diff --git a/indra/llui/llresizebar.cpp b/indra/llui/llresizebar.cpp index e82e93a7ba..82be9672b6 100644 --- a/indra/llui/llresizebar.cpp +++ b/indra/llui/llresizebar.cpp @@ -50,6 +50,7 @@ LLResizeBar::LLResizeBar( const LLString& name, LLView* resizing_view, const LLR mMaxSize( max_size ), mSide( side ), mSnappingEnabled(TRUE), + mAllowDoubleClickSnapping(TRUE), mResizingView(resizing_view) { // set up some generically good follow code. @@ -260,27 +261,31 @@ BOOL LLResizeBar::handleDoubleClick(S32 x, S32 y, MASK mask) LLRect orig_rect = mResizingView->getRect(); LLRect scaled_rect = orig_rect; - if (mSnappingEnabled) + if (mSnappingEnabled && mAllowDoubleClickSnapping) { switch( mSide ) { case LEFT: mResizingView->findSnapEdge(scaled_rect.mLeft, LLCoordGL(0, 0), SNAP_LEFT, SNAP_PARENT_AND_SIBLINGS, S32_MAX); + scaled_rect.mLeft = scaled_rect.mRight - llclamp(scaled_rect.getWidth(), mMinSize, mMaxSize); break; case TOP: mResizingView->findSnapEdge(scaled_rect.mTop, LLCoordGL(0, 0), SNAP_TOP, SNAP_PARENT_AND_SIBLINGS, S32_MAX); + scaled_rect.mTop = scaled_rect.mBottom + llclamp(scaled_rect.getHeight(), mMinSize, mMaxSize); break; case RIGHT: mResizingView->findSnapEdge(scaled_rect.mRight, LLCoordGL(0, 0), SNAP_RIGHT, SNAP_PARENT_AND_SIBLINGS, S32_MAX); + scaled_rect.mRight = scaled_rect.mLeft + llclamp(scaled_rect.getWidth(), mMinSize, mMaxSize); break; case BOTTOM: mResizingView->findSnapEdge(scaled_rect.mBottom, LLCoordGL(0, 0), SNAP_BOTTOM, SNAP_PARENT_AND_SIBLINGS, S32_MAX); + scaled_rect.mBottom = scaled_rect.mTop - llclamp(scaled_rect.getHeight(), mMinSize, mMaxSize); break; } + + mResizingView->userSetShape(scaled_rect); } - mResizingView->reshape(scaled_rect.getWidth(), scaled_rect.getHeight()); - mResizingView->setOrigin(scaled_rect.mLeft, scaled_rect.mBottom); return TRUE; } -- cgit v1.2.3