[ros-diffs] [weiden] 29670: Tweak the ScrollDC implementation a bit so that it produces a better output. The implementation still is completely incorrect as it should call the driver for this operation instead of doing a BitBlt operation...

weiden at svn.reactos.org weiden at svn.reactos.org
Fri Oct 19 05:23:05 CEST 2007


Author: weiden
Date: Fri Oct 19 07:23:04 2007
New Revision: 29670

URL: http://svn.reactos.org/svn/reactos?rev=29670&view=rev
Log:
Tweak the ScrollDC implementation a bit so that it produces a better output. The implementation still is completely incorrect as it should call the driver for this operation instead of doing a BitBlt operation...

Modified:
    trunk/reactos/subsystems/win32/win32k/ntuser/painting.c

Modified: trunk/reactos/subsystems/win32/win32k/ntuser/painting.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntuser/painting.c?rev=29670&r1=29669&r2=29670&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/painting.c (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/painting.c Fri Oct 19 07:23:04 2007
@@ -1132,27 +1132,39 @@
 {
    PDC pDC;
    RECT rcScroll, rcSrc, rcDst;
+   SIZE szSrcOrg;
    INT Result;
 
    IntGdiGetClipBox(hDC, &rcScroll);
+   if (prcClip)
+   {
+      IntGdiIntersectRect(&rcScroll, &rcScroll, prcClip);
+   }
+
    if (prcScroll)
    {
-      IntGdiIntersectRect(&rcScroll, &rcScroll, prcScroll);
-   }
-   if (prcClip)
-   {
-      IntGdiIntersectRect(&rcScroll, &rcScroll, prcClip);
-   }
-
-   rcDst = rcScroll;
+      IntGdiIntersectRect(&rcSrc, &rcScroll, prcScroll);
+   }
+   else
+   {
+      rcSrc = rcScroll;
+   }
+
+   rcDst = rcSrc;
    IntGdiOffsetRect(&rcDst, dx, dy);
+   if (rcDst.left < rcScroll.left)
+       szSrcOrg.cx = rcScroll.left - rcDst.left;
+   else
+       szSrcOrg.cx = 0;
+   if (rcDst.top < rcScroll.top)
+       szSrcOrg.cy = rcScroll.top - rcDst.top;
+   else
+       szSrcOrg.cy = 0;
    IntGdiIntersectRect(&rcDst, &rcDst, &rcScroll);
-   rcSrc = rcDst;
-   IntGdiOffsetRect(&rcSrc, -dx, -dy);
 
    if (!NtGdiBitBlt(hDC, rcDst.left, rcDst.top,
                     rcDst.right - rcDst.left, rcDst.bottom - rcDst.top,
-                    hDC, rcSrc.left, rcSrc.top, SRCCOPY, 0, 0))
+                    hDC, rcSrc.left + szSrcOrg.cx, rcSrc.top + szSrcOrg.cy, SRCCOPY, 0, 0))
    {
       return ERROR;
    }




More information about the Ros-diffs mailing list