From 9849a423d65ebc368b9a763c2d65732a69e39802 Mon Sep 17 00:00:00 2001 From: Thomas Bluemel Date: Fri, 19 Oct 2007 03:23:04 +0000 Subject: [PATCH] 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... svn path=/trunk/; revision=29670 --- .../subsystems/win32/win32k/ntuser/painting.c | 28 +++++++++++++------ 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/reactos/subsystems/win32/win32k/ntuser/painting.c b/reactos/subsystems/win32/win32k/ntuser/painting.c index 5a44fc1e5d4..508b0c6bbe8 100644 --- a/reactos/subsystems/win32/win32k/ntuser/painting.c +++ b/reactos/subsystems/win32/win32k/ntuser/painting.c @@ -1132,27 +1132,39 @@ UserScrollDC(HDC hDC, INT dx, INT dy, const RECT *prcScroll, { PDC pDC; RECT rcScroll, rcSrc, rcDst; + SIZE szSrcOrg; INT Result; IntGdiGetClipBox(hDC, &rcScroll); - if (prcScroll) - { - IntGdiIntersectRect(&rcScroll, &rcScroll, prcScroll); - } if (prcClip) { IntGdiIntersectRect(&rcScroll, &rcScroll, prcClip); } - rcDst = rcScroll; + if (prcScroll) + { + 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; }