Commit b3ab012a authored by Alexandre Julliard's avatar Alexandre Julliard

gdi32: Don't clip to the visible rectangle for screen DCs.

parent fdef173c
...@@ -32,11 +32,12 @@ WINE_DEFAULT_DEBUG_CHANNEL(clipping); ...@@ -32,11 +32,12 @@ WINE_DEFAULT_DEBUG_CHANNEL(clipping);
/* return the DC visible rectangle if not empty */ /* return the DC visible rectangle if not empty */
static inline BOOL get_dc_visrect( DC *dc, RECT *rect ) static inline BOOL get_dc_visrect( DC *dc, RECT *rect )
{ {
if (dc->header.type != OBJ_MEMDC) return FALSE;
rect->left = 0; rect->left = 0;
rect->top = 0; rect->top = 0;
rect->right = dc->vis_rect.right - dc->vis_rect.left; rect->right = dc->vis_rect.right - dc->vis_rect.left;
rect->bottom = dc->vis_rect.bottom - dc->vis_rect.top; rect->bottom = dc->vis_rect.bottom - dc->vis_rect.top;
return !is_rect_empty( rect ); return TRUE;
} }
/*********************************************************************** /***********************************************************************
...@@ -114,19 +115,16 @@ void update_dc_clipping( DC * dc ) ...@@ -114,19 +115,16 @@ void update_dc_clipping( DC * dc )
*/ */
static inline void create_default_clip_region( DC * dc ) static inline void create_default_clip_region( DC * dc )
{ {
UINT width, height; RECT rect;
if (dc->header.type == OBJ_MEMDC) if (!get_dc_visrect( dc, &rect ))
{ {
width = dc->vis_rect.right - dc->vis_rect.left; rect.left = 0;
height = dc->vis_rect.bottom - dc->vis_rect.top; rect.top = 0;
rect.right = GetDeviceCaps( dc->hSelf, DESKTOPHORZRES );
rect.bottom = GetDeviceCaps( dc->hSelf, DESKTOPVERTRES );
} }
else dc->hClipRgn = CreateRectRgnIndirect( &rect );
{
width = GetDeviceCaps( dc->hSelf, DESKTOPHORZRES );
height = GetDeviceCaps( dc->hSelf, DESKTOPVERTRES );
}
dc->hClipRgn = CreateRectRgn( 0, 0, width, height );
} }
...@@ -363,9 +361,9 @@ BOOL WINAPI PtVisible( HDC hdc, INT x, INT y ) ...@@ -363,9 +361,9 @@ BOOL WINAPI PtVisible( HDC hdc, INT x, INT y )
pt.y = y; pt.y = y;
LPtoDP( hdc, &pt, 1 ); LPtoDP( hdc, &pt, 1 );
update_dc( dc ); update_dc( dc );
ret = (get_dc_visrect( dc, &visrect ) && ret = (!get_dc_visrect( dc, &visrect ) ||
pt.x >= visrect.left && pt.x < visrect.right && (pt.x >= visrect.left && pt.x < visrect.right &&
pt.y >= visrect.top && pt.y < visrect.bottom); pt.y >= visrect.top && pt.y < visrect.bottom));
if (ret && get_dc_region( dc )) ret = PtInRegion( get_dc_region( dc ), pt.x, pt.y ); if (ret && get_dc_region( dc )) ret = PtInRegion( get_dc_region( dc ), pt.x, pt.y );
release_dc_ptr( dc ); release_dc_ptr( dc );
return ret; return ret;
...@@ -387,7 +385,7 @@ BOOL WINAPI RectVisible( HDC hdc, const RECT* rect ) ...@@ -387,7 +385,7 @@ BOOL WINAPI RectVisible( HDC hdc, const RECT* rect )
LPtoDP( hdc, (POINT *)&tmpRect, 2 ); LPtoDP( hdc, (POINT *)&tmpRect, 2 );
update_dc( dc ); update_dc( dc );
ret = (get_dc_visrect( dc, &visrect ) && intersect_rect( &visrect, &visrect, &tmpRect )); ret = (!get_dc_visrect( dc, &visrect ) || intersect_rect( &visrect, &visrect, &tmpRect ));
if (ret && get_dc_region( dc )) ret = RectInRegion( get_dc_region( dc ), &tmpRect ); if (ret && get_dc_region( dc )) ret = RectInRegion( get_dc_region( dc ), &tmpRect );
release_dc_ptr( dc ); release_dc_ptr( dc );
return ret; return ret;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment