user32: Fix checkbox wrong box alignment with BS_VCENTER.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zhiyi Zhang 2018-04-27 11:38:05 +08:00 committed by Alexandre Julliard
parent d6654dbf2b
commit 60fad890db
1 changed files with 2 additions and 2 deletions

View File

@ -902,14 +902,14 @@ static void CB_Paint( HWND hwnd, HDC hDC, UINT action )
/* rbox must have the correct height */ /* rbox must have the correct height */
delta = rbox.bottom - rbox.top - checkBoxHeight; delta = rbox.bottom - rbox.top - checkBoxHeight;
if (style & BS_TOP) { if ((style & BS_VCENTER) == BS_TOP) {
if (delta > 0) { if (delta > 0) {
rbox.bottom = rbox.top + checkBoxHeight; rbox.bottom = rbox.top + checkBoxHeight;
} else { } else {
rbox.top -= -delta/2 + 1; rbox.top -= -delta/2 + 1;
rbox.bottom = rbox.top + checkBoxHeight; rbox.bottom = rbox.top + checkBoxHeight;
} }
} else if (style & BS_BOTTOM) { } else if ((style & BS_VCENTER) == BS_BOTTOM) {
if (delta > 0) { if (delta > 0) {
rbox.top = rbox.bottom - checkBoxHeight; rbox.top = rbox.bottom - checkBoxHeight;
} else { } else {