Fixed painting problems in non-MM_TEXT modes.

This commit is contained in:
Ulrich Weigand 2000-10-23 00:35:28 +00:00 committed by Alexandre Julliard
parent 959d73e8dd
commit 409eb44eb0
3 changed files with 25 additions and 9 deletions

View File

@ -1190,8 +1190,15 @@ BOOL REGION_LPTODP( HDC hdc, HRGN hDest, HRGN hSrc )
tmpRect.top = YLPTODP( dc, tmpRect.top );
tmpRect.right = XLPTODP( dc, tmpRect.right );
tmpRect.bottom = YLPTODP( dc, tmpRect.bottom );
if (tmpRect.left > tmpRect.right)
{ INT tmp = tmpRect.left; tmpRect.left = tmpRect.right; tmpRect.right = tmp; }
if (tmpRect.top > tmpRect.bottom)
{ INT tmp = tmpRect.top; tmpRect.top = tmpRect.bottom; tmpRect.bottom = tmp; }
REGION_UnionRectWithRegion( &tmpRect, destObj->rgn );
}
ret = TRUE;
GDI_ReleaseObj( hDest );
GDI_ReleaseObj( hSrc );

View File

@ -354,13 +354,13 @@ HDC WINAPI BeginPaint( HWND hwnd, PAINTSTRUCT *lps )
than the window itself, so we need to intersect the cliprect with
the window */
GetClipBox( lps->hdc, &clipRect );
GetClientRect( hwnd, &clientRect );
/* The rect obtained by GetClipBox is in logical, so make the client in logical to*/
DPtoLP(lps->hdc, (LPPOINT)&clientRect, 2);
GetClipBox( lps->hdc, &clipRect );
LPtoDP(lps->hdc, (LPPOINT)&clipRect, 2); /* GetClipBox returns LP */
IntersectRect(&lps->rcPaint, &clientRect, &clipRect);
DPtoLP(lps->hdc, (LPPOINT)&lps->rcPaint, 2); /* we must return LP */
TRACE("box = (%i,%i - %i,%i)\n", lps->rcPaint.left, lps->rcPaint.top,
lps->rcPaint.right, lps->rcPaint.bottom );

View File

@ -97,18 +97,27 @@ BOOL WINAPI ScrollDC( HDC hdc, INT dx, INT dy, const RECT *rc,
dc->wndOrgY, dc->wndExtY, dc->vportOrgY, dc->vportExtY );
*/
/* compute device clipping region */
/* compute device clipping region (in device coordinates) */
if ( rc )
rect = *rc;
else /* maybe we should just return FALSE? */
GetClipBox( hdc, &rect );
LPtoDP( hdc, (LPPOINT)&rect, 2 );
if (prLClip)
IntersectRect( &rClip,&rect,prLClip );
{
rClip = *prLClip;
LPtoDP( hdc, (LPPOINT)&rClip, 2 );
IntersectRect( &rClip, &rect, &rClip );
}
else
rClip = rect;
dx = XLPTODP ( dc, rect.left + dx ) - XLPTODP ( dc, rect.left );
dy = YLPTODP ( dc, rect.top + dy ) - YLPTODP ( dc, rect.top );
rSrc = rClip;
OffsetRect( &rSrc, -dx, -dy );
IntersectRect( &rSrc, &rSrc, &rect );
@ -121,6 +130,10 @@ BOOL WINAPI ScrollDC( HDC hdc, INT dx, INT dy, const RECT *rc,
dest.y = (src.y = rSrc.top) + dy;
/* copy bits */
DPtoLP( hdc, (LPPOINT)&rSrc, 2 );
DPtoLP( hdc, &src, 1 );
DPtoLP( hdc, &dest, 1 );
if (!BitBlt( hdc, dest.x, dest.y,
rSrc.right - rSrc.left, rSrc.bottom - rSrc.top,
@ -139,10 +152,6 @@ BOOL WINAPI ScrollDC( HDC hdc, INT dx, INT dy, const RECT *rc,
(hrgnUpdate) ? hrgnUpdate : CreateRectRgn( 0,0,0,0 );
HRGN hrgn2;
dx = XLPTODP ( dc, rect.left + dx) - XLPTODP ( dc, rect.left);
dy = YLPTODP ( dc, rect.top + dy) - YLPTODP ( dc, rect.top);
LPtoDP( hdc, (LPPOINT)&rect, 2 );
LPtoDP( hdc, (LPPOINT)&rClip, 2 );
hrgn2 = CreateRectRgnIndirect( &rect );
OffsetRgn( hrgn2, dc->w.DCOrgX, dc->w.DCOrgY );
CombineRgn( hrgn2, hrgn2, dc->w.hVisRgn, RGN_AND );