[PATCH 2/4] d3dx9: Fully initialize the glyph position.

Sven Baars sbaars at codeweavers.com
Tue Nov 17 08:33:30 CST 2020


Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49376
Signed-off-by: Sven Baars <sbaars at codeweavers.com>
---
 dlls/d3dx9_36/font.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/dlls/d3dx9_36/font.c b/dlls/d3dx9_36/font.c
index 4b909406df1..235ae11072b 100644
--- a/dlls/d3dx9_36/font.c
+++ b/dlls/d3dx9_36/font.c
@@ -726,7 +726,6 @@ static INT WINAPI ID3DXFontImpl_DrawTextW(ID3DXFont *iface, ID3DXSprite *sprite,
     {
         unsigned int line_len, i;
         GCP_RESULTSW results;
-        D3DXVECTOR3 pos;
 
         string = read_line(font->hdc, string, &count, line, &line_len, width, format, &size);
 
@@ -756,6 +755,7 @@ static INT WINAPI ID3DXFontImpl_DrawTextW(ID3DXFont *iface, ID3DXSprite *sprite,
         for (i = 0; i < results.nGlyphs; ++i)
         {
             IDirect3DTexture9 *texture;
+            D3DXVECTOR3 pos;
             POINT cell_inc;
             RECT black_box;
 
@@ -766,6 +766,7 @@ static INT WINAPI ID3DXFontImpl_DrawTextW(ID3DXFont *iface, ID3DXSprite *sprite,
 
             pos.x = cell_inc.x + x + results.lpCaretPos[i];
             pos.y = cell_inc.y + y;
+            pos.z = 0;
 
             ID3DXSprite_Draw(target, texture, &black_box, NULL, &pos, color);
             IDirect3DTexture9_Release(texture);
-- 
2.25.1




More information about the wine-devel mailing list