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

commit a244e4f6ddbfee4f66e3e1ea5b9f48e09465dbc1
Author:     Katayama Hirofumi MZ <[email protected]>
AuthorDate: Mon Sep 10 00:37:37 2018 +0900
Commit:     Hermès BÉLUSCA - MAÏTO <[email protected]>
CommitDate: Sun Sep 9 17:37:37 2018 +0200

    [WIN32SS][COMCTL32] Fix button text Y positioning (#766)
    
    Fixes the vertical position of button text.
    CORE-14906
---
 dll/win32/comctl32/button.c           | 4 ++++
 win32ss/user/user32/controls/button.c | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/dll/win32/comctl32/button.c b/dll/win32/comctl32/button.c
index bc9336d705..813aa7455d 100644
--- a/dll/win32/comctl32/button.c
+++ b/dll/win32/comctl32/button.c
@@ -1273,7 +1273,11 @@ static UINT BUTTON_CalcLabelRect(const BUTTON_INFO 
*infoPtr, HDC hdc, RECT *rc)
    {
       case DT_TOP:     r.top++;  r.bottom++;  break;
       case DT_VCENTER: n = r.bottom - r.top;
+#ifdef __REACTOS__
+                       r.top    = rc->top + ((rc->bottom - 1 - rc->top) - n) / 
2;
+#else
                        r.top    = rc->top + ((rc->bottom - rc->top) - n) / 2;
+#endif
                        r.bottom = r.top + n;  break;
       case DT_BOTTOM:  n = r.bottom - r.top;
                        r.bottom = rc->bottom - 1;
diff --git a/win32ss/user/user32/controls/button.c 
b/win32ss/user/user32/controls/button.c
index 2538a9847b..6e7d70e77e 100644
--- a/win32ss/user/user32/controls/button.c
+++ b/win32ss/user/user32/controls/button.c
@@ -832,7 +832,11 @@ static UINT BUTTON_CalcLabelRect(HWND hwnd, HDC hdc, RECT 
*rc)
    {
       case DT_TOP:     r.top++;  r.bottom++;  break;
       case DT_VCENTER: n = r.bottom - r.top;
+#ifdef __REACTOS__
+                       r.top    = rc->top + ((rc->bottom - 1 - rc->top) - n) / 
2;
+#else
                        r.top    = rc->top + ((rc->bottom - rc->top) - n) / 2;
+#endif
                        r.bottom = r.top + n;  break;
       case DT_BOTTOM:  n = r.bottom - r.top;
                        r.bottom = rc->bottom - 1;

Reply via email to