Fix return value for OffsetRgn if x and y are 0.

This commit is contained in:
Huw D M Davies 2000-04-18 11:54:29 +00:00 committed by Alexandre Julliard
parent a3d3ff8d34
commit f46e1d8a51

View File

@ -505,14 +505,17 @@ INT16 WINAPI OffsetRgn16( HRGN16 hrgn, INT16 x, INT16 y )
INT WINAPI OffsetRgn( HRGN hrgn, INT x, INT y )
{
RGNOBJ * obj = (RGNOBJ *) GDI_GetObjPtr( hrgn, REGION_MAGIC );
INT ret;
if (obj && (x || y))
{
INT ret;
TRACE("%04x %d,%d\n", hrgn, x, y);
if (!obj)
return ERROR;
if(x || y) {
int nbox = obj->rgn->numRects;
RECT *pbox = obj->rgn->rects;
TRACE(" %04x %d,%d\n", hrgn, x, y );
if(nbox) {
while(nbox--) {
pbox->left += x;
@ -526,11 +529,10 @@ INT WINAPI OffsetRgn( HRGN hrgn, INT x, INT y )
obj->rgn->extents.top += y;
obj->rgn->extents.bottom += y;
}
ret = obj->rgn->type;
GDI_HEAP_UNLOCK( hrgn );
return ret;
}
return ERROR;
ret = obj->rgn->type;
GDI_HEAP_UNLOCK( hrgn );
return ret;
}