1 // NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #include "nel/misc/rect.h"
20 #include "nel/misc/vector_2f.h"
28 // *********************************************************************
29 void CRect::extend (sint32 x
, sint32 y
)
36 else if (x
>=(X
+(sint32
)Width
))
37 Width
=(uint32
)(x
-X
+1);
40 Height
+=(uint32
)(Y
-y
);
43 else if (y
>=(Y
+(sint32
)Height
))
44 Height
=(uint32
)(y
-Y
+1);
48 // *********************************************************************
49 void CRect::setWH(sint32 x
, sint32 y
, uint32 width
, uint32 height
)
58 // *********************************************************************
59 void CRect::set(sint32 x0
, sint32 y0
, sint32 x1
, sint32 y1
)
84 // *********************************************************************
85 CRect::CRect (sint32 x
, sint32 y
, uint32 width
, uint32 height
)
87 setWH(x
, y
, width
, height
);