fix all gdi32 gdiobj winetests

svn path=/trunk/; revision=43545
This commit is contained in:
Christoph von Wittich 2009-10-17 21:04:04 +00:00
parent e3d7acd1d3
commit 72a954c01c

View file

@ -2988,20 +2988,47 @@ BOOL
FASTCALL FASTCALL
REGION_RectInRegion( REGION_RectInRegion(
PROSRGNDATA Rgn, PROSRGNDATA Rgn,
const RECTL *rc const RECTL *rect
) )
{ {
PRECTL pCurRect, pRectEnd; PRECTL pCurRect, pRectEnd;
RECT rc;
// this is (just) a useful optimization /* swap the coordinates to make right >= left and bottom >= top */
if ((Rgn->rdh.nCount > 0) && EXTENTCHECK(&Rgn->rdh.rcBound, rc)) /* (region building rectangles are normalized the same way) */
if( rect->top > rect->bottom) {
rc.top = rect->bottom;
rc.bottom = rect->top;
} else {
rc.top = rect->top;
rc.bottom = rect->bottom;
}
if( rect->right < rect->left) {
rc.right = rect->left;
rc.left = rect->right;
} else {
rc.right = rect->right;
rc.left = rect->left;
}
/* this is (just) a useful optimization */
if ((Rgn->rdh.nCount > 0) && EXTENTCHECK(&Rgn->rdh.rcBound, &rc))
{ {
for (pCurRect = Rgn->Buffer, pRectEnd = pCurRect + Rgn->rdh.nCount; pCurRect < pRectEnd; pCurRect++) for (pCurRect = Rgn->Buffer, pRectEnd = pCurRect +
Rgn->rdh.nCount; pCurRect < pRectEnd; pCurRect++)
{ {
if (pCurRect->bottom <= rc->top) continue; // not far enough down yet if (pCurRect->bottom <= rc.top)
if (pCurRect->top >= rc->bottom) break; // too far down continue; /* not far enough down yet */
if (pCurRect->right <= rc->left) continue; // not far enough over yet
if (pCurRect->left >= rc->right) continue; if (pCurRect->top >= rc.bottom)
break; /* too far down */
if (pCurRect->right <= rc.left)
continue; /* not far enough over yet */
if (pCurRect->left >= rc.right) {
continue;
}
return TRUE; return TRUE;
} }