mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +00:00
[WINESYNC] d3dx9: Handle clipping in ID3DXFont_DrawText.
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 6da3e904a1efc921030fdbe34070b981bf57524c by Sven Baars <sbaars@codeweavers.com>
This commit is contained in:
parent
9363eac228
commit
818c9f88b0
3 changed files with 7 additions and 2 deletions
|
@ -563,6 +563,9 @@ static INT WINAPI ID3DXFontImpl_DrawTextW(ID3DXFont *iface, ID3DXSprite *sprite,
|
||||||
if (!count)
|
if (!count)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
if (format & DT_CALCRECT)
|
||||||
|
format |= DT_NOCLIP;
|
||||||
|
|
||||||
if (!rect)
|
if (!rect)
|
||||||
{
|
{
|
||||||
y = ID3DXFont_DrawTextW(iface, NULL, string, count, &textrect, format | DT_CALCRECT, 0);
|
y = ID3DXFont_DrawTextW(iface, NULL, string, count, &textrect, format | DT_CALCRECT, 0);
|
||||||
|
@ -641,6 +644,8 @@ static INT WINAPI ID3DXFontImpl_DrawTextW(ID3DXFont *iface, ID3DXSprite *sprite,
|
||||||
heap_free(results.lpGlyphs);
|
heap_free(results.lpGlyphs);
|
||||||
}
|
}
|
||||||
y += lh;
|
y += lh;
|
||||||
|
if (!(DT_NOCLIP & format) && (y > textrect.bottom))
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = y - textrect.top;
|
ret = y - textrect.top;
|
||||||
|
|
|
@ -780,7 +780,7 @@ static void test_ID3DXFont(IDirect3DDevice9 *device)
|
||||||
todo_wine ok(height == 36, "Got unexpected height %d.\n", height);
|
todo_wine ok(height == 36, "Got unexpected height %d.\n", height);
|
||||||
|
|
||||||
height = ID3DXFont_DrawTextW(font, NULL, L"1\n2\n3\n4\n5\n6", -1, &rect, 0, 0xff00ff);
|
height = ID3DXFont_DrawTextW(font, NULL, L"1\n2\n3\n4\n5\n6", -1, &rect, 0, 0xff00ff);
|
||||||
todo_wine ok(height == 48, "Got unexpected height %d.\n", height);
|
ok(height == 48, "Got unexpected height %d.\n", height);
|
||||||
|
|
||||||
height = ID3DXFont_DrawTextW(font, NULL, L"1\n2\n3\n4\n5\n6", -1, &rect, DT_NOCLIP, 0xff00ff);
|
height = ID3DXFont_DrawTextW(font, NULL, L"1\n2\n3\n4\n5\n6", -1, &rect, DT_NOCLIP, 0xff00ff);
|
||||||
ok(height == 72, "Got unexpected height %d.\n", height);
|
ok(height == 72, "Got unexpected height %d.\n", height);
|
||||||
|
|
|
@ -15,4 +15,4 @@ files: {include/d3dx9.h: sdk/include/dxsdk/d3dx9.h, include/d3dx9anim.h: sdk/inc
|
||||||
include/d3dx9mesh.h: sdk/include/dxsdk/d3dx9mesh.h, include/d3dx9of.h: sdk/include/dxsdk/d3dx9of.h,
|
include/d3dx9mesh.h: sdk/include/dxsdk/d3dx9mesh.h, include/d3dx9of.h: sdk/include/dxsdk/d3dx9of.h,
|
||||||
include/d3dx9shader.h: sdk/include/dxsdk/d3dx9shader.h, include/d3dx9shape.h: sdk/include/dxsdk/d3dx9shape.h,
|
include/d3dx9shader.h: sdk/include/dxsdk/d3dx9shader.h, include/d3dx9shape.h: sdk/include/dxsdk/d3dx9shape.h,
|
||||||
include/d3dx9tex.h: sdk/include/dxsdk/d3dx9tex.h, include/d3dx9xof.h: sdk/include/dxsdk/d3dx9xof.h}
|
include/d3dx9tex.h: sdk/include/dxsdk/d3dx9tex.h, include/d3dx9xof.h: sdk/include/dxsdk/d3dx9xof.h}
|
||||||
tags: {wine: 330c3f9108191feb6eb888384befb5cb54645233}
|
tags: {wine: 6da3e904a1efc921030fdbe34070b981bf57524c}
|
||||||
|
|
Loading…
Reference in a new issue