[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:
winesync 2021-01-05 13:16:38 +01:00 committed by Jérôme Gardou
parent 9567bb87bd
commit 06bd040614
2 changed files with 16 additions and 2 deletions

View file

@ -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);
}

View file

@ -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