mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +00:00
[WINESYNC] d3dx9: Implement clipping of glyphs in ID3DXFont_DrawText.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49546 Signed-off-by: Sven Baars <sbaars@codeweavers.com> Signed-off-by: Matteo Bruni <mbruni@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 84cbf6a49dfe75b9fd497b2c3ef7e922857bb618 by Sven Baars <sbaars@codeweavers.com>
This commit is contained in:
parent
9567bb87bd
commit
06bd040614
2 changed files with 16 additions and 2 deletions
|
@ -587,7 +587,6 @@ static const WCHAR *read_line(HDC hdc, const WCHAR *str, unsigned int *count,
|
|||
}
|
||||
else if (format & DT_SINGLELINE)
|
||||
{
|
||||
*dest_len = num_fit;
|
||||
*count = 0;
|
||||
}
|
||||
}
|
||||
|
@ -772,6 +771,21 @@ static INT WINAPI ID3DXFontImpl_DrawTextW(ID3DXFont *iface, ID3DXSprite *sprite,
|
|||
pos.y = cell_inc.y + y;
|
||||
pos.z = 0;
|
||||
|
||||
if (!(format & DT_NOCLIP))
|
||||
{
|
||||
if (pos.x > rect->right)
|
||||
{
|
||||
IDirect3DTexture9_Release(texture);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (pos.x + black_box.right - black_box.left > rect->right)
|
||||
black_box.right = black_box.left + rect->right - pos.x;
|
||||
|
||||
if (pos.y + black_box.bottom - black_box.top > rect->bottom)
|
||||
black_box.bottom = black_box.top + rect->bottom - pos.y;
|
||||
}
|
||||
|
||||
ID3DXSprite_Draw(target, texture, &black_box, NULL, &pos, color);
|
||||
IDirect3DTexture9_Release(texture);
|
||||
}
|
||||
|
|
|
@ -34,4 +34,4 @@ files:
|
|||
include/d3dx9tex.h: sdk/include/dxsdk/d3dx9tex.h
|
||||
include/d3dx9xof.h: sdk/include/dxsdk/d3dx9xof.h
|
||||
tags:
|
||||
wine: 2481e617bbd529a297266ad53b1afe1d96e9af89
|
||||
wine: 84cbf6a49dfe75b9fd497b2c3ef7e922857bb618
|
||||
|
|
Loading…
Reference in a new issue