From 1cc451d8076058a6a3edd5f6359e8b71e7fb5fb8 Mon Sep 17 00:00:00 2001 From: Katayama Hirofumi MZ Date: Sat, 16 May 2020 13:39:26 +0900 Subject: [PATCH 1/2] Revert "[COMCTL32][USER32] Fix radio button regression (#2146)" This reverts commit 2d4d3f5fce0c875d3e714c51de16dfb0cd0a9cd3. --- dll/win32/comctl32/button.c | 4 ---- win32ss/user/user32/controls/button.c | 4 ---- 2 files changed, 8 deletions(-) diff --git a/dll/win32/comctl32/button.c b/dll/win32/comctl32/button.c index db207499e67..37dab409b0d 100644 --- a/dll/win32/comctl32/button.c +++ b/dll/win32/comctl32/button.c @@ -1211,11 +1211,7 @@ static UINT BUTTON_CalcLabelRect(const BUTTON_INFO *infoPtr, HDC hdc, RECT *rc) } if ((hFont = infoPtr->font)) hPrevFont = SelectObject( hdc, hFont ); -#ifdef __REACTOS__ - DrawTextW(hdc, text, -1, &r, ((dtStyle | DT_CALCRECT) & ~(DT_VCENTER | DT_BOTTOM))); -#else DrawTextW(hdc, text, -1, &r, dtStyle | DT_CALCRECT); -#endif if (hPrevFont) SelectObject( hdc, hPrevFont ); heap_free( text ); #ifdef __REACTOS__ diff --git a/win32ss/user/user32/controls/button.c b/win32ss/user/user32/controls/button.c index 6b65c536795..df7fb0e7810 100644 --- a/win32ss/user/user32/controls/button.c +++ b/win32ss/user/user32/controls/button.c @@ -773,11 +773,7 @@ static UINT BUTTON_CalcLabelRect(HWND hwnd, HDC hdc, RECT *rc) } if ((hFont = get_button_font( hwnd ))) hPrevFont = SelectObject( hdc, hFont ); -#ifdef __REACTOS__ - DrawTextW(hdc, text, -1, &r, ((dtStyle | DT_CALCRECT) & ~(DT_VCENTER | DT_BOTTOM))); -#else DrawTextW(hdc, text, -1, &r, dtStyle | DT_CALCRECT); -#endif if (hPrevFont) SelectObject( hdc, hPrevFont ); HeapFree( GetProcessHeap(), 0, text ); #ifdef __REACTOS__ From 853a8c95506d773d221b5435d050580892e4ff79 Mon Sep 17 00:00:00 2001 From: Katayama Hirofumi MZ Date: Sat, 16 May 2020 21:03:20 +0900 Subject: [PATCH 2/2] revert more --- win32ss/user/rtl/text.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/win32ss/user/rtl/text.c b/win32ss/user/rtl/text.c index 0ab3f00ea31..4c58b9140f4 100644 --- a/win32ss/user/rtl/text.c +++ b/win32ss/user/rtl/text.c @@ -1263,8 +1263,18 @@ INT WINAPI DrawTextExWorker( HDC hdc, if (flags & DT_SINGLELINE) { #ifdef __REACTOS__ - if (flags & DT_VCENTER) y = rect->top + - (rect->bottom - rect->top + (invert_y ? size.cy : -size.cy)) / 2; + 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; + } + } else if (flags & DT_BOTTOM) y = rect->bottom + (invert_y ? size.cy : -size.cy); #else