diff options
author | Leyla Farazha <leyla@lindenlab.com> | 2011-09-27 15:41:06 -0700 |
---|---|---|
committer | Leyla Farazha <leyla@lindenlab.com> | 2011-09-27 15:41:06 -0700 |
commit | 0207d7e9e4e5b509b5905256a56ac2138b35cac3 (patch) | |
tree | 904c34ad82f59d0515600b7745252036404f81f1 /indra/llui | |
parent | cb699e3f2d64999e9817d0c4df5b7f9484e8e722 (diff) |
EXP-1247 Nearby chat as part of chat floater
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/llresizehandle.cpp | 12 | ||||
-rw-r--r-- | indra/llui/llresizehandle.h | 5 |
2 files changed, 17 insertions, 0 deletions
diff --git a/indra/llui/llresizehandle.cpp b/indra/llui/llresizehandle.cpp index c3a51c36c9..942e84eeb6 100644 --- a/indra/llui/llresizehandle.cpp +++ b/indra/llui/llresizehandle.cpp @@ -55,6 +55,8 @@ LLResizeHandle::LLResizeHandle(const LLResizeHandle::Params& p) mImage( NULL ), mMinWidth( p.min_width ), mMinHeight( p.min_height ), + mMaxWidth(S32_MAX), + mMaxHeight(S32_MAX), mCorner( p.corner ) { if( RIGHT_BOTTOM == mCorner) @@ -177,6 +179,11 @@ BOOL LLResizeHandle::handleHover(S32 x, S32 y, MASK mask) new_width = mMinWidth; delta_x = x_multiple * (mMinWidth - orig_rect.getWidth()); } + else if (new_width > mMaxWidth) + { + new_width = mMaxWidth; + delta_x = x_multiple * (mMaxWidth - orig_rect.getWidth()); + } S32 new_height = orig_rect.getHeight() + y_multiple * delta_y; if( new_height < mMinHeight ) @@ -184,6 +191,11 @@ BOOL LLResizeHandle::handleHover(S32 x, S32 y, MASK mask) new_height = mMinHeight; delta_y = y_multiple * (mMinHeight - orig_rect.getHeight()); } + else if (new_height > mMaxHeight) + { + new_height = mMaxHeight; + delta_y = y_multiple * (mMaxHeight - orig_rect.getHeight()); + } switch( mCorner ) { diff --git a/indra/llui/llresizehandle.h b/indra/llui/llresizehandle.h index 531eb1db61..5cfe3fb63c 100644 --- a/indra/llui/llresizehandle.h +++ b/indra/llui/llresizehandle.h @@ -56,6 +56,9 @@ public: void setResizeLimits( S32 min_width, S32 min_height ) { mMinWidth = min_width; mMinHeight = min_height; } + void setMaxWidth(S32 width) { mMaxWidth = width;} + void setMaxHeight(S32 height) { mMaxHeight = height;} + private: BOOL pointInHandle( S32 x, S32 y ); @@ -66,7 +69,9 @@ private: LLCoordGL mLastMouseDir; LLPointer<LLUIImage> mImage; S32 mMinWidth; + S32 mMaxWidth; S32 mMinHeight; + S32 mMaxHeight; const ECorner mCorner; }; |