mirror of
https://github.com/reactos/reactos.git
synced 2024-07-06 20:55:16 +00:00
[WINESYNC] d3dx9_36: Fix horizontal centering in ID3DXFont_DrawText.
Fix remaining text issues in Air Strike. Should fix text placement in Stronghold Kingdoms. wine-staging patch by Christian Costa <titan.costa@gmail.com>
This commit is contained in:
parent
cbed631506
commit
5b56f3d681
|
@ -253,6 +253,13 @@ static INT WINAPI ID3DXFontImpl_DrawTextW(ID3DXFont *iface, ID3DXSprite *sprite,
|
||||||
return height;
|
return height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (format & DT_CENTER)
|
||||||
|
{
|
||||||
|
UINT new_width = calc_rect.right - calc_rect.left;
|
||||||
|
calc_rect.left = (rect->right + rect->left - new_width) / 2;
|
||||||
|
calc_rect.right = calc_rect.left + new_width;
|
||||||
|
}
|
||||||
|
|
||||||
if (height && (calc_rect.left < calc_rect.right))
|
if (height && (calc_rect.left < calc_rect.right))
|
||||||
{
|
{
|
||||||
D3DLOCKED_RECT locked_rect;
|
D3DLOCKED_RECT locked_rect;
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
diff --git a/dll/directx/wine/d3dx9_36/font.c b/dll/directx/wine/d3dx9_36/font.c
|
||||||
|
index 2e2f696..e8689bb 100644
|
||||||
|
--- a/dll/directx/wine/d3dx9_36/font.c
|
||||||
|
+++ b/dll/directx/wine/d3dx9_36/font.c
|
||||||
|
@@ -253,6 +253,13 @@ static INT WINAPI ID3DXFontImpl_DrawTextW(ID3DXFont *iface, ID3DXSprite *sprite,
|
||||||
|
return height;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ if (format & DT_CENTER)
|
||||||
|
+ {
|
||||||
|
+ UINT new_width = calc_rect.right - calc_rect.left;
|
||||||
|
+ calc_rect.left = (rect->right + rect->left - new_width) / 2;
|
||||||
|
+ calc_rect.right = calc_rect.left + new_width;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
if (height && (calc_rect.left < calc_rect.right))
|
||||||
|
{
|
||||||
|
D3DLOCKED_RECT locked_rect;
|
Loading…
Reference in a new issue