Default Clipping Region Should Be Resolution of DC

Robert Shearman rob at codeweavers.com
Thu Sep 2 09:19:51 CDT 2004


Changelog:
Default clipping region should be resolution of the DC, not the current 
visible region.

-------------- next part --------------
Index: wine/dlls/gdi/clipping.c
===================================================================
RCS file: /home/wine/wine/dlls/gdi/clipping.c,v
retrieving revision 1.2
diff -u -p -r1.2 clipping.c
--- wine/dlls/gdi/clipping.c	20 Aug 2004 19:26:28 -0000	1.2
+++ wine/dlls/gdi/clipping.c	2 Sep 2004 14:16:28 -0000
@@ -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, HR
     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
         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 );
         }


More information about the wine-patches mailing list