[NtGDI]
authorJames Tabor <james.tabor@reactos.org>
Wed, 31 Aug 2016 16:20:57 +0000 (16:20 +0000)
committerJames Tabor <james.tabor@reactos.org>
Wed, 31 Aug 2016 16:20:57 +0000 (16:20 +0000)
- Patch by Sebastian Gasiorek : Fix incorrect placement of the text in the Tab buttons. Implement TA_UPDATECP. See CORE-1578 and CORE-11415.

svn path=/trunk/; revision=72521

reactos/win32ss/gdi/ntgdi/freetype.c

index 210cd17..bc33b69 100644 (file)
@@ -3408,9 +3408,15 @@ GreExtTextOutW(
         IntLPtoDP(dc, (POINT *)lprc, 2);
     }
 
-    Start.x = XStart;
-    Start.y = YStart;
-    IntLPtoDP(dc, &Start, 1);
+    if(pdcattr->lTextAlign & TA_UPDATECP)
+    {
+        Start.x = pdcattr->ptlCurrent.x;
+        Start.y = pdcattr->ptlCurrent.y;
+    } else {
+        Start.x = XStart;
+        Start.y = YStart;
+        IntLPtoDP(dc, &Start, 1);
+    }
 
     RealXStart = ((LONGLONG)Start.x + dc->ptlDCOrig.x) << 6;
     YStart = Start.y + dc->ptlDCOrig.y;
@@ -3842,6 +3848,11 @@ GreExtTextOutW(
 
         String++;
     }
+
+    if (pdcattr->lTextAlign & TA_UPDATECP) {
+        pdcattr->ptlCurrent.x = DestRect.right - dc->ptlDCOrig.x;
+    }
+
     IntUnLockFreeType;
 
     DC_vFinishBlit(dc, NULL) ;