From: Maotong Zhang <zmtong1988@gmail.com> Clamp child height between cyMinChild and cyMaxChild when no height increment is specified. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=58683 --- dlls/comctl32/rebar.c | 6 +++++- dlls/comctl32/tests/rebar.c | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dlls/comctl32/rebar.c b/dlls/comctl32/rebar.c index 15bc0d5aaec..6708c418467 100644 --- a/dlls/comctl32/rebar.c +++ b/dlls/comctl32/rebar.c @@ -465,7 +465,11 @@ static int round_child_height(const REBAR_BAND *lpBand, int cyHeight) { int cy = 0; if (lpBand->cyIntegral == 0) - return min(cyHeight, lpBand->cyMaxChild); + { + cyHeight = max(cyHeight, (int)lpBand->cyMinChild); + cyHeight = min(cyHeight, (int)lpBand->cyMaxChild); + return cyHeight; + } cy = max(cyHeight - (int)lpBand->cyMinChild, 0); cy = lpBand->cyMinChild + (cy/lpBand->cyIntegral) * lpBand->cyIntegral; cy = min(cy, lpBand->cyMaxChild); diff --git a/dlls/comctl32/tests/rebar.c b/dlls/comctl32/tests/rebar.c index cb34f2a94b0..26b48a075fb 100644 --- a/dlls/comctl32/tests/rebar.c +++ b/dlls/comctl32/tests/rebar.c @@ -721,7 +721,6 @@ static void test_layout(void) rbi.fMask = RBBIM_CHILDSIZE; ok(SendMessageA(hRebar, RB_GETBANDINFOA, 0, (LPARAM)&rbi), "RB_GETBANDINFOA failed\n"); - todo_wine compare(rbi.cyChild, 10, "%d"); DestroyWindow(hRebar); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11540