Commit 84cbf6a4 authored by Sven Baars's avatar Sven Baars Committed by Alexandre Julliard

d3dx9: Implement clipping of glyphs in ID3DXFont_DrawText.

parent 2481e617
......@@ -583,7 +583,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;
}
}
......@@ -768,6 +767,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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment