https://git.reactos.org/?p=reactos.git;a=commitdiff;h=635534005b8754ef7ad0c9b20b6295a362461cf6

commit 635534005b8754ef7ad0c9b20b6295a362461cf6
Author:     Katayama Hirofumi MZ <[email protected]>
AuthorDate: Tue Apr 2 22:39:26 2019 +0900
Commit:     GitHub <[email protected]>
CommitDate: Tue Apr 2 22:39:26 2019 +0900

    [WIN32SS][FONT] Fix font coordinate conversion CORE-15907 (#1452)
    
    [WIN32SS][FONT] Fix font bounding box mapping for viewport CORE-15907
---
 win32ss/gdi/ntgdi/freetype.c | 45 ++++++++++++++++++++++++++++----------------
 1 file changed, 29 insertions(+), 16 deletions(-)

diff --git a/win32ss/gdi/ntgdi/freetype.c b/win32ss/gdi/ntgdi/freetype.c
index 5f9b2213ea..7e5307a716 100644
--- a/win32ss/gdi/ntgdi/freetype.c
+++ b/win32ss/gdi/ntgdi/freetype.c
@@ -5880,28 +5880,41 @@ IntExtTextOutW(
     // invert y axis
     IntEscapeMatrix(&matEscape, -lfEscapement);
 
+    matWorld.yx = -matWorld.yx;
+    matWorld.xy = -matWorld.xy;
+
     // convert vecs
     for (i = 0; i < 9; ++i)
     {
-        POINT pt;
         FT_Vector_Transform(&vecs[i], &matWidth);
         FT_Vector_Transform(&vecs[i], &matEscape);
-        vecs[i].x += (Start.x << 16) + (XStart64 << 10);
-        vecs[i].y += (Start.y << 16) + (YStart64 << 10);
-        pt.x = vecs[i].x >> 16;
-        pt.y = vecs[i].y >> 16;
+        FT_Vector_Transform(&vecs[i], &matWorld);
+    }
+    vecs[2].x += DeltaX64 << 10;
+    vecs[2].y += DeltaY64 << 10;     // upper right
+    vecs[3].x += DeltaX64 << 10;
+    vecs[3].y += DeltaY64 << 10;     // lower right
+    vecs[6].x += DeltaX64 << 10;
+    vecs[6].y += DeltaY64 << 10;     // underline right
+    vecs[8].x += DeltaX64 << 10;
+    vecs[8].y += DeltaY64 << 10;     // strike through right
+
+    {
+        POINT pt;
+        pt.x = Start.x + (XStart64 >> 6);
+        pt.y = Start.y + (YStart64 >> 6);
         IntLPtoDP(dc, &pt, 1);
-        vecs[i].x = pt.x + dc->ptlDCOrig.x;
-        vecs[i].y = pt.y + dc->ptlDCOrig.y;
-    }
-    vecs[2].x += DeltaX64 >> 6;
-    vecs[2].y += DeltaY64 >> 6;     // upper right
-    vecs[3].x += DeltaX64 >> 6;
-    vecs[3].y += DeltaY64 >> 6;     // lower right
-    vecs[6].x += DeltaX64 >> 6;
-    vecs[6].y += DeltaY64 >> 6;     // underline right
-    vecs[8].x += DeltaX64 >> 6;
-    vecs[8].y += DeltaY64 >> 6;     // strike through right
+
+        for (i = 0; i < 9; ++i)
+        {
+            vecs[i].x += pt.x << 16;
+            vecs[i].y += pt.y << 16;
+            vecs[i].x >>= 16;
+            vecs[i].y >>= 16;
+            vecs[i].x += dc->ptlDCOrig.x;
+            vecs[i].y += dc->ptlDCOrig.y;
+        }
+    }
 
     if (fuOptions & ETO_OPAQUE)
     {

Reply via email to