mirror of
https://github.com/reactos/reactos.git
synced 2024-09-15 23:28:15 +00:00
5b56f3d681
Fix remaining text issues in Air Strike. Should fix text placement in Stronghold Kingdoms. wine-staging patch by Christian Costa <titan.costa@gmail.com>
19 lines
653 B
Diff
19 lines
653 B
Diff
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;
|