Fixed painting problems in non-MM_TEXT modes.
This commit is contained in:
parent
959d73e8dd
commit
409eb44eb0
|
@ -1190,8 +1190,15 @@ BOOL REGION_LPTODP( HDC hdc, HRGN hDest, HRGN hSrc )
|
||||||
tmpRect.top = YLPTODP( dc, tmpRect.top );
|
tmpRect.top = YLPTODP( dc, tmpRect.top );
|
||||||
tmpRect.right = XLPTODP( dc, tmpRect.right );
|
tmpRect.right = XLPTODP( dc, tmpRect.right );
|
||||||
tmpRect.bottom = YLPTODP( dc, tmpRect.bottom );
|
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 );
|
REGION_UnionRectWithRegion( &tmpRect, destObj->rgn );
|
||||||
}
|
}
|
||||||
|
ret = TRUE;
|
||||||
|
|
||||||
GDI_ReleaseObj( hDest );
|
GDI_ReleaseObj( hDest );
|
||||||
GDI_ReleaseObj( hSrc );
|
GDI_ReleaseObj( hSrc );
|
||||||
|
|
|
@ -354,13 +354,13 @@ HDC WINAPI BeginPaint( HWND hwnd, PAINTSTRUCT *lps )
|
||||||
than the window itself, so we need to intersect the cliprect with
|
than the window itself, so we need to intersect the cliprect with
|
||||||
the window */
|
the window */
|
||||||
|
|
||||||
GetClipBox( lps->hdc, &clipRect );
|
|
||||||
GetClientRect( hwnd, &clientRect );
|
GetClientRect( hwnd, &clientRect );
|
||||||
|
|
||||||
/* The rect obtained by GetClipBox is in logical, so make the client in logical to*/
|
GetClipBox( lps->hdc, &clipRect );
|
||||||
DPtoLP(lps->hdc, (LPPOINT)&clientRect, 2);
|
LPtoDP(lps->hdc, (LPPOINT)&clipRect, 2); /* GetClipBox returns LP */
|
||||||
|
|
||||||
IntersectRect(&lps->rcPaint, &clientRect, &clipRect);
|
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,
|
TRACE("box = (%i,%i - %i,%i)\n", lps->rcPaint.left, lps->rcPaint.top,
|
||||||
lps->rcPaint.right, lps->rcPaint.bottom );
|
lps->rcPaint.right, lps->rcPaint.bottom );
|
||||||
|
|
|
@ -97,18 +97,27 @@ BOOL WINAPI ScrollDC( HDC hdc, INT dx, INT dy, const RECT *rc,
|
||||||
dc->wndOrgY, dc->wndExtY, dc->vportOrgY, dc->vportExtY );
|
dc->wndOrgY, dc->wndExtY, dc->vportOrgY, dc->vportExtY );
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* compute device clipping region */
|
/* compute device clipping region (in device coordinates) */
|
||||||
|
|
||||||
if ( rc )
|
if ( rc )
|
||||||
rect = *rc;
|
rect = *rc;
|
||||||
else /* maybe we should just return FALSE? */
|
else /* maybe we should just return FALSE? */
|
||||||
GetClipBox( hdc, &rect );
|
GetClipBox( hdc, &rect );
|
||||||
|
|
||||||
|
LPtoDP( hdc, (LPPOINT)&rect, 2 );
|
||||||
|
|
||||||
if (prLClip)
|
if (prLClip)
|
||||||
IntersectRect( &rClip,&rect,prLClip );
|
{
|
||||||
|
rClip = *prLClip;
|
||||||
|
LPtoDP( hdc, (LPPOINT)&rClip, 2 );
|
||||||
|
IntersectRect( &rClip, &rect, &rClip );
|
||||||
|
}
|
||||||
else
|
else
|
||||||
rClip = rect;
|
rClip = rect;
|
||||||
|
|
||||||
|
dx = XLPTODP ( dc, rect.left + dx ) - XLPTODP ( dc, rect.left );
|
||||||
|
dy = YLPTODP ( dc, rect.top + dy ) - YLPTODP ( dc, rect.top );
|
||||||
|
|
||||||
rSrc = rClip;
|
rSrc = rClip;
|
||||||
OffsetRect( &rSrc, -dx, -dy );
|
OffsetRect( &rSrc, -dx, -dy );
|
||||||
IntersectRect( &rSrc, &rSrc, &rect );
|
IntersectRect( &rSrc, &rSrc, &rect );
|
||||||
|
@ -122,6 +131,10 @@ BOOL WINAPI ScrollDC( HDC hdc, INT dx, INT dy, const RECT *rc,
|
||||||
|
|
||||||
/* copy bits */
|
/* copy bits */
|
||||||
|
|
||||||
|
DPtoLP( hdc, (LPPOINT)&rSrc, 2 );
|
||||||
|
DPtoLP( hdc, &src, 1 );
|
||||||
|
DPtoLP( hdc, &dest, 1 );
|
||||||
|
|
||||||
if (!BitBlt( hdc, dest.x, dest.y,
|
if (!BitBlt( hdc, dest.x, dest.y,
|
||||||
rSrc.right - rSrc.left, rSrc.bottom - rSrc.top,
|
rSrc.right - rSrc.left, rSrc.bottom - rSrc.top,
|
||||||
hdc, src.x, src.y, SRCCOPY))
|
hdc, src.x, src.y, SRCCOPY))
|
||||||
|
@ -139,10 +152,6 @@ BOOL WINAPI ScrollDC( HDC hdc, INT dx, INT dy, const RECT *rc,
|
||||||
(hrgnUpdate) ? hrgnUpdate : CreateRectRgn( 0,0,0,0 );
|
(hrgnUpdate) ? hrgnUpdate : CreateRectRgn( 0,0,0,0 );
|
||||||
HRGN hrgn2;
|
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 );
|
hrgn2 = CreateRectRgnIndirect( &rect );
|
||||||
OffsetRgn( hrgn2, dc->w.DCOrgX, dc->w.DCOrgY );
|
OffsetRgn( hrgn2, dc->w.DCOrgX, dc->w.DCOrgY );
|
||||||
CombineRgn( hrgn2, hrgn2, dc->w.hVisRgn, RGN_AND );
|
CombineRgn( hrgn2, hrgn2, dc->w.hVisRgn, RGN_AND );
|
||||||
|
|
Loading…
Reference in New Issue