From bce67c86c4caf1596d786b138031ecd33a25e19f Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Wed, 7 Jul 2004 16:34:33 +0000 Subject: [PATCH] - Fixed ExcludeClipRgn for case when DC contained no clipping region before the call to this function. svn path=/trunk/; revision=10014 --- reactos/subsys/win32k/objects/cliprgn.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/reactos/subsys/win32k/objects/cliprgn.c b/reactos/subsys/win32k/objects/cliprgn.c index 71b819e50d6..c2b3bb6dcc8 100644 --- a/reactos/subsys/win32k/objects/cliprgn.c +++ b/reactos/subsys/win32k/objects/cliprgn.c @@ -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 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)