From a355c84d28012b240c1fd1d7f82d51ed05699e49 Mon Sep 17 00:00:00 2001 From: Robert Shearman Date: Thu, 2 Sep 2004 20:08:30 +0000 Subject: [PATCH] Default clipping region should be resolution of the DC, not the current visible region. --- dlls/gdi/clipping.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/dlls/gdi/clipping.c b/dlls/gdi/clipping.c index c39835d86b7..3570f91d1a5 100644 --- a/dlls/gdi/clipping.c +++ b/dlls/gdi/clipping.c @@ -51,6 +51,18 @@ void CLIPPING_UpdateGCRegion( DC * dc ) dc->funcs->pSetDeviceClipping( dc->physDev, dc->hVisRgn, dc->hClipRgn ); } +/*********************************************************************** + * create_default_clip_rgn + * + * Create a default clipping region when none already exists. + */ +static inline void create_default_clip_region( DC * dc ) +{ + dc->hClipRgn = CreateRectRgn(0, 0, + GetDeviceCaps( dc->hSelf, HORZRES ), + GetDeviceCaps( dc->hSelf, VERTRES )); +} + /*********************************************************************** * SelectClipRgn (GDI32.@) @@ -97,11 +109,7 @@ INT WINAPI ExtSelectClipRgn( HDC hdc, HRGN hrgn, INT fnMode ) else { if (!dc->hClipRgn) - { - RECT rect; - GetRgnBox( dc->hVisRgn, &rect ); - dc->hClipRgn = CreateRectRgnIndirect( &rect ); - } + create_default_clip_region( dc ); if(fnMode == RGN_COPY) CombineRgn( dc->hClipRgn, hrgn, 0, fnMode ); @@ -206,10 +214,7 @@ INT WINAPI ExcludeClipRect( HDC hdc, INT left, INT top, else { if (!dc->hClipRgn) - { - dc->hClipRgn = CreateRectRgn( 0, 0, 0, 0 ); - CombineRgn( dc->hClipRgn, dc->hVisRgn, 0, RGN_COPY ); - } + create_default_clip_region( dc ); ret = CombineRgn( dc->hClipRgn, dc->hClipRgn, newRgn, RGN_DIFF ); DeleteObject( newRgn ); }