Commit 930e8394 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

x11drv: ScrollDC fix.

There is no need to offset the source rectangle in the reverse direction before scrolling.
parent 1e946d3e
...@@ -94,27 +94,32 @@ BOOL X11DRV_ScrollDC( HDC hdc, INT dx, INT dy, const RECT *lprcScroll, ...@@ -94,27 +94,32 @@ BOOL X11DRV_ScrollDC( HDC hdc, INT dx, INT dy, const RECT *lprcScroll,
* rect are scrolled. So first combine Scroll and Clipping rectangles, * rect are scrolled. So first combine Scroll and Clipping rectangles,
* if available */ * if available */
if( lprcScroll) if( lprcScroll)
{
if( lprcClip) if( lprcClip)
IntersectRect( &rcClip, lprcClip, lprcScroll); IntersectRect( &rcClip, lprcClip, lprcScroll);
else else
rcClip = *lprcScroll; rcClip = *lprcScroll;
}
else else
{
if( lprcClip) if( lprcClip)
rcClip = *lprcClip; rcClip = *lprcClip;
else else
GetClipBox( hdc, &rcClip); GetClipBox( hdc, &rcClip);
}
/* Then clip again to get the source rectangle that will remain in the /* Then clip again to get the source rectangle that will remain in the
* clipping rect */ * clipping rect */
rcSrc = rcClip; rcSrc = rcClip;
OffsetRect( &rcSrc, -dx, -dy);
IntersectRect( &rcSrc, &rcSrc, &rcClip); IntersectRect( &rcSrc, &rcSrc, &rcClip);
/* now convert to device coordinates */ /* now convert to device coordinates */
LPtoDP(hdc, (LPPOINT)&rcSrc, 2); LPtoDP(hdc, (LPPOINT)&rcSrc, 2);
TRACE("source rect: %s\n", wine_dbgstr_rect(&rcSrc));
/* also dx and dy */ /* also dx and dy */
SetRect(&offset, 0, 0, dx, dy); SetRect(&offset, 0, 0, dx, dy);
LPtoDP(hdc, (LPPOINT)&offset, 2); LPtoDP(hdc, (LPPOINT)&offset, 2);
dxdev = offset.right - offset.left; 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 /* now intersect with the visible region to get the pixels that will
* actually scroll */ * actually scroll */
DstRgn = CreateRectRgnIndirect( &rcSrc); DstRgn = CreateRectRgnIndirect( &rcSrc);
...@@ -133,6 +138,8 @@ BOOL X11DRV_ScrollDC( HDC hdc, INT dx, INT dy, const RECT *lprcScroll, ...@@ -133,6 +138,8 @@ BOOL X11DRV_ScrollDC( HDC hdc, INT dx, INT dy, const RECT *lprcScroll,
SelectClipRgn( hdc, DstRgn); SelectClipRgn( hdc, DstRgn);
GetRgnBox( DstRgn, &rect); GetRgnBox( DstRgn, &rect);
DPtoLP(hdc, (LPPOINT)&rect, 2); DPtoLP(hdc, (LPPOINT)&rect, 2);
TRACE("destination rect: %s\n", wine_dbgstr_rect(&rect));
BitBlt( hdc, rect.left, rect.top, BitBlt( hdc, rect.left, rect.top,
rect.right - rect.left, rect.bottom -rect.top, rect.right - rect.left, rect.bottom -rect.top,
hdc, rect.left - dx, rect.top - dy, SRCCOPY); hdc, rect.left - dx, rect.top - dy, SRCCOPY);
...@@ -149,7 +156,7 @@ BOOL X11DRV_ScrollDC( HDC hdc, INT dx, INT dy, const RECT *lprcScroll, ...@@ -149,7 +156,7 @@ BOOL X11DRV_ScrollDC( HDC hdc, INT dx, INT dy, const RECT *lprcScroll,
code = X11DRV_END_EXPOSURES; code = X11DRV_END_EXPOSURES;
ExtEscape( hdc, X11DRV_ESCAPE, sizeof(code), (LPSTR)&code, ExtEscape( hdc, X11DRV_ESCAPE, sizeof(code), (LPSTR)&code,
sizeof(ExpRgn), (LPSTR)&ExpRgn ); 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); LPtoDP(hdc, (LPPOINT)&rcClip, 2);
if( hrgn ) if( hrgn )
SetRectRgn( hrgn, rcClip.left, rcClip.top, rcClip.right, SetRectRgn( hrgn, rcClip.left, rcClip.top, rcClip.right,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment