Commit 1da826a1 authored by Alexandre Julliard's avatar Alexandre Julliard

gdi32: Fix text positioning in mirrored DCs.

parent 7d776a86
...@@ -1715,6 +1715,7 @@ BOOL WINAPI ExtTextOutW( HDC hdc, INT x, INT y, UINT flags, ...@@ -1715,6 +1715,7 @@ BOOL WINAPI ExtTextOutW( HDC hdc, INT x, INT y, UINT flags,
LPWSTR reordered_str = (LPWSTR)str; LPWSTR reordered_str = (LPWSTR)str;
WORD *glyphs = NULL; WORD *glyphs = NULL;
UINT align = GetTextAlign( hdc ); UINT align = GetTextAlign( hdc );
DWORD layout = GetLayout( hdc );
POINT pt; POINT pt;
TEXTMETRICW tm; TEXTMETRICW tm;
LOGFONTW lf; LOGFONTW lf;
...@@ -1755,17 +1756,23 @@ BOOL WINAPI ExtTextOutW( HDC hdc, INT x, INT y, UINT flags, ...@@ -1755,17 +1756,23 @@ BOOL WINAPI ExtTextOutW( HDC hdc, INT x, INT y, UINT flags,
if (!lprect) if (!lprect)
flags &= ~ETO_CLIPPED; flags &= ~ETO_CLIPPED;
if (flags & ETO_RTLREADING) align |= TA_RTLREADING;
if (layout & LAYOUT_RTL)
{
if ((align & TA_CENTER) != TA_CENTER) align ^= TA_RIGHT;
align ^= TA_RTLREADING;
}
if( !(flags & (ETO_GLYPH_INDEX | ETO_IGNORELANGUAGE)) && count > 0 ) if( !(flags & (ETO_GLYPH_INDEX | ETO_IGNORELANGUAGE)) && count > 0 )
{ {
INT cGlyphs; INT cGlyphs;
reordered_str = HeapAlloc(GetProcessHeap(), 0, count*sizeof(WCHAR)); reordered_str = HeapAlloc(GetProcessHeap(), 0, count*sizeof(WCHAR));
BIDI_Reorder( hdc, str, count, GCP_REORDER, BIDI_Reorder( hdc, str, count, GCP_REORDER,
((flags&ETO_RTLREADING)!=0 || (GetTextAlign(hdc)&TA_RTLREADING)!=0)? (align & TA_RTLREADING) ? WINE_GCPW_FORCE_RTL : WINE_GCPW_FORCE_LTR,
WINE_GCPW_FORCE_RTL:WINE_GCPW_FORCE_LTR,
reordered_str, count, NULL, &glyphs, &cGlyphs); reordered_str, count, NULL, &glyphs, &cGlyphs);
flags |= ETO_IGNORELANGUAGE; flags |= ETO_IGNORELANGUAGE;
if (glyphs) if (glyphs)
{ {
...@@ -1901,6 +1908,7 @@ BOOL WINAPI ExtTextOutW( HDC hdc, INT x, INT y, UINT flags, ...@@ -1901,6 +1908,7 @@ BOOL WINAPI ExtTextOutW( HDC hdc, INT x, INT y, UINT flags,
LPtoDP(hdc, desired, 2); LPtoDP(hdc, desired, 2);
desired[1].x -= desired[0].x; desired[1].x -= desired[0].x;
desired[1].y -= desired[0].y; desired[1].y -= desired[0].y;
if (layout & LAYOUT_RTL) desired[1].x = -desired[1].x;
deltas[i].x = desired[1].x - width.x; deltas[i].x = desired[1].x - width.x;
deltas[i].y = desired[1].y - width.y; deltas[i].y = desired[1].y - width.y;
......
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