[PATCH] comctl32: Fix checkbox wrong box alignment with BS_VCENTER.

Zhiyi Zhang zzhang at codeweavers.com
Wed Apr 25 08:17:22 CDT 2018


BS_VCENTER shares bit field with BS_TOP and BS_BOTTOM. Thus
the condition can't base on only logic AND.

Signed-off-by: Zhiyi Zhang <zzhang at codeweavers.com>
---
 dlls/comctl32/button.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/comctl32/button.c b/dlls/comctl32/button.c
index 1feb07ae64..507820cf45 100644
--- a/dlls/comctl32/button.c
+++ b/dlls/comctl32/button.c
@@ -1150,14 +1150,14 @@ static void CB_Paint( const BUTTON_INFO *infoPtr, HDC hDC, UINT action )
 	/* rbox must have the correct height */
 	delta = rbox.bottom - rbox.top - checkBoxHeight;
 
-	if (style & BS_TOP) {
+	if ((style & BS_VCENTER) == BS_TOP) {
 	    if (delta > 0) {
 		rbox.bottom = rbox.top + checkBoxHeight;
 	    } else {
 		rbox.top -= -delta/2 + 1;
 		rbox.bottom = rbox.top + checkBoxHeight;
 	    }
-	} else if (style & BS_BOTTOM) {
+	} else if ((style & BS_VCENTER) == BS_BOTTOM) {
 	    if (delta > 0) {
 		rbox.top = rbox.bottom - checkBoxHeight;
 	    } else {
-- 
2.17.0





More information about the wine-devel mailing list