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

commit e329e83857db0db67c6798c538ad658be044057e
Author:     Katayama Hirofumi MZ <[email protected]>
AuthorDate: Mon Dec 9 21:16:28 2019 +0900
Commit:     GitHub <[email protected]>
CommitDate: Mon Dec 9 21:16:28 2019 +0900

    [WIN32SS][COMCTL32] Improve button text position (#2135)
    
    Improve DrawText function especially DT_CALCRECT and DT_VCENTER. CORE-15478
---
 win32ss/user/rtl/text.c | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/win32ss/user/rtl/text.c b/win32ss/user/rtl/text.c
index 7670e2e5956..8963b0d0831 100644
--- a/win32ss/user/rtl/text.c
+++ b/win32ss/user/rtl/text.c
@@ -1263,18 +1263,8 @@ INT WINAPI DrawTextExWorker( HDC hdc,
        if (flags & DT_SINGLELINE)
        {
 #ifdef __REACTOS__
-        if (flags & DT_VCENTER)
-        {
-            if (flags & DT_CALCRECT)
-            {
-                if (rect->bottom - rect->top < size.cy / 2)
-                    y = rect->top + (invert_y ? size.cy : -size.cy) / 2;
-            }
-            else
-            {
-                y = rect->top + (rect->bottom - rect->top + (invert_y ? 
size.cy : -size.cy)) / 2;
-            }
-        }
+        if (flags & DT_VCENTER) y = rect->top +
+            (rect->bottom - rect->top + (invert_y ? size.cy : -size.cy)) / 2;
         else if (flags & DT_BOTTOM)
             y = rect->bottom + (invert_y ? 0 : -size.cy);
 #else

Reply via email to