Only offset the rect if it's not empty, otherwise we might return negative
authorGé van Geldorp <ge@gse.nl>
Sun, 4 Dec 2005 22:30:27 +0000 (22:30 +0000)
committerGé van Geldorp <ge@gse.nl>
Sun, 4 Dec 2005 22:30:27 +0000 (22:30 +0000)
values

svn path=/trunk/; revision=19893

reactos/subsys/win32k/ntuser/painting.c

index 0f8d1c9..575dc4e 100644 (file)
@@ -769,9 +769,12 @@ NtUserBeginPaint(HWND hWnd, PAINTSTRUCT* UnsafePs)
          UnsafeIntGetRgnBox(Rgn, &Ps.rcPaint);
          RGNDATA_UnlockRgn(Rgn);
          IntGdiIntersectRect(&Ps.rcPaint, &Ps.rcPaint, &Window->ClientRect);
-         IntGdiOffsetRect(&Ps.rcPaint,
-                          -Window->ClientRect.left,
-                          -Window->ClientRect.top);
+         if (! IntGdiIsEmptyRect(&Ps.rcPaint))
+         {
+            IntGdiOffsetRect(&Ps.rcPaint,
+                             -Window->ClientRect.left,
+                             -Window->ClientRect.top);
+         }
       }
       else
       {