From 2e32d44e7165775936beae5d9ef636ff9d3f2bd2 Mon Sep 17 00:00:00 2001 From: Steven Bennetts Date: Tue, 19 Feb 2008 21:42:32 +0000 Subject: merge svn+ssh://svn.lindenlab.com/svn/linden/qa/combo-merge-ui-2008-02-13 -r 79986 : 80178 -> release. QAR-290 = QAR-271 + QAR-191 --- indra/llmath/llrect.h | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) (limited to 'indra/llmath/llrect.h') diff --git a/indra/llmath/llrect.h b/indra/llmath/llrect.h index e7b15dcc58..1fa5a741d5 100644 --- a/indra/llmath/llrect.h +++ b/indra/llmath/llrect.h @@ -152,68 +152,74 @@ public: mBottom <= rect->mTop && rect->mBottom <= mTop ; } - void set(Type left, Type top, Type right, Type bottom) + LLRectBase& set(Type left, Type top, Type right, Type bottom) { mLeft = left; mTop = top; mRight = right; mBottom = bottom; + return *this; } // Note: follows GL_QUAD conventions: the top and right edges are not considered part of the rect - void setOriginAndSize( Type left, Type bottom, Type width, Type height) + LLRectBase& setOriginAndSize( Type left, Type bottom, Type width, Type height) { mLeft = left; mTop = bottom + height; mRight = left + width; mBottom = bottom; + return *this; } // Note: follows GL_QUAD conventions: the top and right edges are not considered part of the rect - void setLeftTopAndSize( Type left, Type top, Type width, Type height) + LLRectBase& setLeftTopAndSize( Type left, Type top, Type width, Type height) { mLeft = left; mTop = top; mRight = left + width; mBottom = top - height; + return *this; } - void setCenterAndSize(Type x, Type y, Type width, Type height) + LLRectBase& setCenterAndSize(Type x, Type y, Type width, Type height) { mLeft = x - width/2; mTop = y + height/2; mRight = x + width/2; mBottom = y - height/2; + return *this; } - void translate(Type horiz, Type vertical) + LLRectBase& translate(Type horiz, Type vertical) { mLeft += horiz; mRight += horiz; mTop += vertical; mBottom += vertical; + return *this; } - void stretch( Type dx, Type dy) + LLRectBase& stretch( Type dx, Type dy) { mLeft -= dx; mRight += dx; mTop += dy; mBottom -= dy; - makeValid(); + return makeValid(); } - void stretch( Type delta ) + LLRectBase& stretch( Type delta ) { stretch(delta, delta); - + return *this; } - void makeValid() + LLRectBase& makeValid() { mLeft = llmin(mLeft, mRight); mBottom = llmin(mBottom, mTop); + return *this; } bool isNull() const @@ -221,15 +227,16 @@ public: return mLeft == mRight || mBottom == mTop; } - void unionWith(const LLRectBase &other) + LLRectBase& unionWith(const LLRectBase &other) { mLeft = llmin(mLeft, other.mLeft); mRight = llmax(mRight, other.mRight); mBottom = llmin(mBottom, other.mBottom); mTop = llmax(mTop, other.mTop); + return *this; } - void intersectWith(const LLRectBase &other) + LLRectBase& intersectWith(const LLRectBase &other) { mLeft = llmax(mLeft, other.mLeft); mRight = llmin(mRight, other.mRight); @@ -243,6 +250,7 @@ public: { mBottom = mTop; } + return *this; } friend std::ostream &operator<<(std::ostream &s, const LLRectBase &rect) -- cgit v1.2.3