- Fixed ExcludeClipRgn for case when DC contained no clipping region before the call...
authorFilip Navara <filip.navara@gmail.com>
Wed, 7 Jul 2004 16:34:33 +0000 (16:34 +0000)
committerFilip Navara <filip.navara@gmail.com>
Wed, 7 Jul 2004 16:34:33 +0000 (16:34 +0000)
svn path=/trunk/; revision=10014

reactos/subsys/win32k/objects/cliprgn.c

index 71b819e..c2b3bb6 100644 (file)
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: cliprgn.c,v 1.40 2004/05/26 18:49:06 weiden Exp $ */
+/* $Id: cliprgn.c,v 1.41 2004/07/07 16:34:33 navaraf Exp $ */
 #include <w32k.h>
 
 int FASTCALL
@@ -251,14 +251,18 @@ int STDCALL NtGdiExcludeClipRect(HDC  hDC,
    {
       Result = ERROR;
    }
-   else if (!dc->w.hClipRgn)
-   {
-      dc->w.hClipRgn = NewRgn;
-      Result = SIMPLEREGION;
-   }
    else
    {
-      Result = NtGdiCombineRgn(dc->w.hClipRgn, dc->w.hClipRgn, NewRgn, RGN_DIFF);
+      if (!dc->w.hClipRgn)
+      {
+         dc->w.hClipRgn = NtGdiCreateRectRgn(0, 0, 0, 0);
+         NtGdiCombineRgn(dc->w.hClipRgn, dc->w.hVisRgn, NewRgn, RGN_DIFF);         
+         Result = SIMPLEREGION;
+      }
+      else
+      {
+         Result = NtGdiCombineRgn(dc->w.hClipRgn, dc->w.hClipRgn, NewRgn, RGN_DIFF);
+      }
       NtGdiDeleteObject(NewRgn);
    }
    if (Result != ERROR)