mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
Implemented SubtractRect(). Misc fixes.
svn path=/trunk/; revision=3647
This commit is contained in:
parent
f56af542aa
commit
552baccb19
1 changed files with 35 additions and 5 deletions
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: rect.c,v 1.11 2002/09/17 23:46:23 dwelch Exp $
|
/* $Id: rect.c,v 1.12 2002/10/20 23:57:03 mdill Exp $
|
||||||
*
|
*
|
||||||
* PROJECT: ReactOS user32.dll
|
* PROJECT: ReactOS user32.dll
|
||||||
* FILE: lib/user32/windows/input.c
|
* FILE: lib/user32/windows/input.c
|
||||||
|
@ -37,6 +37,9 @@
|
||||||
WINBOOL STDCALL
|
WINBOOL STDCALL
|
||||||
CopyRect(LPRECT lprcDst, CONST RECT *lprcSrc)
|
CopyRect(LPRECT lprcDst, CONST RECT *lprcSrc)
|
||||||
{
|
{
|
||||||
|
if(lprcDst == NULL || lprcSrc == NULL)
|
||||||
|
return(FALSE);
|
||||||
|
|
||||||
*lprcDst = *lprcSrc;
|
*lprcDst = *lprcSrc;
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
}
|
}
|
||||||
|
@ -64,8 +67,8 @@ InflateRect(LPRECT rect, int dx, int dy)
|
||||||
{
|
{
|
||||||
rect->left -= dx;
|
rect->left -= dx;
|
||||||
rect->top -= dy;
|
rect->top -= dy;
|
||||||
rect->right -= dx;
|
rect->right += dx;
|
||||||
rect->bottom -= dy;
|
rect->bottom += dy;
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,6 +102,9 @@ IsRectEmpty(CONST RECT *lprc)
|
||||||
WINBOOL STDCALL
|
WINBOOL STDCALL
|
||||||
OffsetRect(LPRECT rect, int dx, int dy)
|
OffsetRect(LPRECT rect, int dx, int dy)
|
||||||
{
|
{
|
||||||
|
if(rect == NULL)
|
||||||
|
return(FALSE);
|
||||||
|
|
||||||
rect->left += dx;
|
rect->left += dx;
|
||||||
rect->top += dy;
|
rect->top += dy;
|
||||||
rect->right += dx;
|
rect->right += dx;
|
||||||
|
@ -133,8 +139,32 @@ SetRectEmpty(LPRECT lprc)
|
||||||
WINBOOL STDCALL
|
WINBOOL STDCALL
|
||||||
SubtractRect(LPRECT lprcDst, CONST RECT *lprcSrc1, CONST RECT *lprcSrc2)
|
SubtractRect(LPRECT lprcDst, CONST RECT *lprcSrc1, CONST RECT *lprcSrc2)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED;
|
RECT tempRect;
|
||||||
return FALSE;
|
|
||||||
|
if(lprcDst == NULL || lprcSrc1 == NULL || lprcSrc2 == NULL)
|
||||||
|
return(FALSE);
|
||||||
|
|
||||||
|
CopyRect(lprcDst, lprcSrc1);
|
||||||
|
|
||||||
|
if(!IntersectRect(&tempRect, lprcSrc1, lprcSrc2))
|
||||||
|
return(FALSE);
|
||||||
|
|
||||||
|
if(lprcDst->top == tempRect.top && lprcDst->bottom == tempRect.bottom)
|
||||||
|
{
|
||||||
|
if(lprcDst->left == tempRect.left)
|
||||||
|
lprcDst->left = tempRect.right;
|
||||||
|
else if(lprcDst->right == tempRect.right)
|
||||||
|
lprcDst->right = tempRect.left;
|
||||||
|
}
|
||||||
|
else if(lprcDst->left == tempRect.left && lprcDst->right == tempRect.right)
|
||||||
|
{
|
||||||
|
if(lprcDst->top == tempRect.top)
|
||||||
|
lprcDst->top = tempRect.bottom;
|
||||||
|
else if(lprcDst->right == tempRect.right)
|
||||||
|
lprcDst->right = tempRect.left;
|
||||||
|
}
|
||||||
|
|
||||||
|
return(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
WINBOOL STDCALL
|
WINBOOL STDCALL
|
||||||
|
|
Loading…
Reference in a new issue