Dmitry Timoshkov : x11drv: ScrollDC fix.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Dec 13 12:24:54 CST 2005


Module: wine
Branch: refs/heads/master
Commit: 930e8394a62c70d59ad8b9fb4a9527b7d738fbee
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=930e8394a62c70d59ad8b9fb4a9527b7d738fbee

Author: Dmitry Timoshkov <dmitry at codeweavers.com>
Date:   Tue Dec 13 17:47:27 2005 +0100

x11drv: ScrollDC fix.
There is no need to offset the source rectangle in the reverse
direction before scrolling.

---

 dlls/x11drv/scroll.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/dlls/x11drv/scroll.c b/dlls/x11drv/scroll.c
index 005804a..78144da 100644
--- a/dlls/x11drv/scroll.c
+++ b/dlls/x11drv/scroll.c
@@ -94,27 +94,32 @@ BOOL X11DRV_ScrollDC( HDC hdc, INT dx, I
      * rect are scrolled. So first combine Scroll and Clipping rectangles,
      * if available */
     if( lprcScroll)
+    {
         if( lprcClip)
             IntersectRect( &rcClip, lprcClip, lprcScroll);
         else
             rcClip = *lprcScroll;
+    }
     else
+    {
         if( lprcClip)
             rcClip = *lprcClip;
         else
             GetClipBox( hdc, &rcClip);
+    }
     /* Then clip again to get the source rectangle that will remain in the
      * clipping rect */
     rcSrc = rcClip;
-    OffsetRect( &rcSrc, -dx, -dy);
     IntersectRect( &rcSrc, &rcSrc, &rcClip);
     /* now convert to device coordinates */
     LPtoDP(hdc, (LPPOINT)&rcSrc, 2);
+    TRACE("source rect: %s\n", wine_dbgstr_rect(&rcSrc));
+
     /* also dx and dy */
     SetRect(&offset, 0, 0, dx, dy);
     LPtoDP(hdc, (LPPOINT)&offset, 2);
     dxdev = offset.right - offset.left;
-    dydev= offset.bottom - offset.top;
+    dydev = offset.bottom - offset.top;
     /* now intersect with the visible region to get the pixels that will
      * actually scroll */
     DstRgn = CreateRectRgnIndirect( &rcSrc);
@@ -133,6 +138,8 @@ BOOL X11DRV_ScrollDC( HDC hdc, INT dx, I
             SelectClipRgn( hdc, DstRgn);
         GetRgnBox( DstRgn, &rect);
         DPtoLP(hdc, (LPPOINT)&rect, 2);
+        TRACE("destination rect: %s\n", wine_dbgstr_rect(&rect));
+
         BitBlt( hdc, rect.left, rect.top,
                     rect.right - rect.left, rect.bottom -rect.top,
                     hdc, rect.left - dx, rect.top - dy, SRCCOPY);
@@ -149,7 +156,7 @@ BOOL X11DRV_ScrollDC( HDC hdc, INT dx, I
         code = X11DRV_END_EXPOSURES;
         ExtEscape( hdc, X11DRV_ESCAPE, sizeof(code), (LPSTR)&code,
                 sizeof(ExpRgn), (LPSTR)&ExpRgn );
-        /* Covert the combined clip rectangle to device coordinates */
+        /* Convert the combined clip rectangle to device coordinates */
         LPtoDP(hdc, (LPPOINT)&rcClip, 2);
         if( hrgn )
             SetRectRgn( hrgn, rcClip.left, rcClip.top, rcClip.right,




More information about the wine-cvs mailing list