mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 20:05:41 +00:00
[WINESYNC] d3dx9_36: ID3DXFont_DrawText calc_rect can be null
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com> wine-staging patch by Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
This commit is contained in:
parent
f9c6d6e396
commit
58d515ea16
3 changed files with 90 additions and 2 deletions
|
@ -235,7 +235,7 @@ static INT WINAPI ID3DXFontImpl_DrawTextW(ID3DXFont *iface, ID3DXSprite *sprite,
|
|||
const WCHAR *string, INT count, RECT *rect, DWORD format, D3DCOLOR color)
|
||||
{
|
||||
struct d3dx_font *This = impl_from_ID3DXFont(iface);
|
||||
RECT calc_rect = *rect;
|
||||
RECT calc_rect;
|
||||
INT height;
|
||||
|
||||
TRACE("iface %p, sprite %p, string %s, count %d, rect %s, format %#x, color 0x%08x\n",
|
||||
|
@ -251,11 +251,15 @@ static INT WINAPI ID3DXFontImpl_DrawTextW(ID3DXFont *iface, ID3DXSprite *sprite,
|
|||
while (count > 0 && !string[count-1])
|
||||
count--;
|
||||
|
||||
if (rect)
|
||||
calc_rect = *rect;
|
||||
|
||||
height = DrawTextW(This->hdc, string, count, &calc_rect, format | DT_CALCRECT);
|
||||
|
||||
if (format & DT_CALCRECT)
|
||||
{
|
||||
*rect = calc_rect;
|
||||
if (rect)
|
||||
*rect = calc_rect;
|
||||
return height;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue