aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llui/llresizebar.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:50 -0500
committerJacek Antonelli2008-08-15 23:45:50 -0500
commit2a4dea528f670b9bb1f77ef27a8a1dd16603d114 (patch)
tree95c68e362703c9099d571ecbdc6142b1cda1e005 /linden/indra/llui/llresizebar.cpp
parentSecond Life viewer sources 1.20.6 (diff)
downloadmeta-impy-2a4dea528f670b9bb1f77ef27a8a1dd16603d114.zip
meta-impy-2a4dea528f670b9bb1f77ef27a8a1dd16603d114.tar.gz
meta-impy-2a4dea528f670b9bb1f77ef27a8a1dd16603d114.tar.bz2
meta-impy-2a4dea528f670b9bb1f77ef27a8a1dd16603d114.tar.xz
Second Life viewer sources 1.20.7
Diffstat (limited to 'linden/indra/llui/llresizebar.cpp')
-rw-r--r--linden/indra/llui/llresizebar.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/linden/indra/llui/llresizebar.cpp b/linden/indra/llui/llresizebar.cpp
index e89bfee..fd571a1 100644
--- a/linden/indra/llui/llresizebar.cpp
+++ b/linden/indra/llui/llresizebar.cpp
@@ -50,6 +50,7 @@ LLResizeBar::LLResizeBar( const LLString& name, LLView* resizing_view, const LLR
50 mMaxSize( max_size ), 50 mMaxSize( max_size ),
51 mSide( side ), 51 mSide( side ),
52 mSnappingEnabled(TRUE), 52 mSnappingEnabled(TRUE),
53 mAllowDoubleClickSnapping(TRUE),
53 mResizingView(resizing_view) 54 mResizingView(resizing_view)
54{ 55{
55 // set up some generically good follow code. 56 // set up some generically good follow code.
@@ -260,27 +261,31 @@ BOOL LLResizeBar::handleDoubleClick(S32 x, S32 y, MASK mask)
260 LLRect orig_rect = mResizingView->getRect(); 261 LLRect orig_rect = mResizingView->getRect();
261 LLRect scaled_rect = orig_rect; 262 LLRect scaled_rect = orig_rect;
262 263
263 if (mSnappingEnabled) 264 if (mSnappingEnabled && mAllowDoubleClickSnapping)
264 { 265 {
265 switch( mSide ) 266 switch( mSide )
266 { 267 {
267 case LEFT: 268 case LEFT:
268 mResizingView->findSnapEdge(scaled_rect.mLeft, LLCoordGL(0, 0), SNAP_LEFT, SNAP_PARENT_AND_SIBLINGS, S32_MAX); 269 mResizingView->findSnapEdge(scaled_rect.mLeft, LLCoordGL(0, 0), SNAP_LEFT, SNAP_PARENT_AND_SIBLINGS, S32_MAX);
270 scaled_rect.mLeft = scaled_rect.mRight - llclamp(scaled_rect.getWidth(), mMinSize, mMaxSize);
269 break; 271 break;
270 case TOP: 272 case TOP:
271 mResizingView->findSnapEdge(scaled_rect.mTop, LLCoordGL(0, 0), SNAP_TOP, SNAP_PARENT_AND_SIBLINGS, S32_MAX); 273 mResizingView->findSnapEdge(scaled_rect.mTop, LLCoordGL(0, 0), SNAP_TOP, SNAP_PARENT_AND_SIBLINGS, S32_MAX);
274 scaled_rect.mTop = scaled_rect.mBottom + llclamp(scaled_rect.getHeight(), mMinSize, mMaxSize);
272 break; 275 break;
273 case RIGHT: 276 case RIGHT:
274 mResizingView->findSnapEdge(scaled_rect.mRight, LLCoordGL(0, 0), SNAP_RIGHT, SNAP_PARENT_AND_SIBLINGS, S32_MAX); 277 mResizingView->findSnapEdge(scaled_rect.mRight, LLCoordGL(0, 0), SNAP_RIGHT, SNAP_PARENT_AND_SIBLINGS, S32_MAX);
278 scaled_rect.mRight = scaled_rect.mLeft + llclamp(scaled_rect.getWidth(), mMinSize, mMaxSize);
275 break; 279 break;
276 case BOTTOM: 280 case BOTTOM:
277 mResizingView->findSnapEdge(scaled_rect.mBottom, LLCoordGL(0, 0), SNAP_BOTTOM, SNAP_PARENT_AND_SIBLINGS, S32_MAX); 281 mResizingView->findSnapEdge(scaled_rect.mBottom, LLCoordGL(0, 0), SNAP_BOTTOM, SNAP_PARENT_AND_SIBLINGS, S32_MAX);
282 scaled_rect.mBottom = scaled_rect.mTop - llclamp(scaled_rect.getHeight(), mMinSize, mMaxSize);
278 break; 283 break;
279 } 284 }
285
286 mResizingView->userSetShape(scaled_rect);
280 } 287 }
281 288
282 mResizingView->reshape(scaled_rect.getWidth(), scaled_rect.getHeight());
283 mResizingView->setOrigin(scaled_rect.mLeft, scaled_rect.mBottom);
284 return TRUE; 289 return TRUE;
285} 290}
286 291