gdi32: Stay within the clipping area when painting text background.

This commit is contained in:
David Hedberg 2011-01-30 20:47:55 +08:00 committed by Alexandre Julliard
parent bf192f6ac9
commit 81bbd17c40
1 changed files with 10 additions and 1 deletions

View File

@ -2030,6 +2030,15 @@ BOOL WINAPI ExtTextOutW( HDC hdc, INT x, INT y, UINT flags,
rc.right = x + width.x;
rc.top = y - tm.tmAscent;
rc.bottom = y + tm.tmDescent;
if(flags & ETO_CLIPPED)
{
rc.left = max(lprect->left, rc.left);
rc.right = min(lprect->right, rc.right);
rc.top = max(lprect->top, rc.top);
rc.bottom = min(lprect->bottom, rc.bottom);
}
if(rc.left < rc.right && rc.top < rc.bottom)
dc->funcs->pExtTextOut(dc->physDev, 0, 0, ETO_OPAQUE, &rc, NULL, 0, NULL);
}
}