Commit 1b8c98d3 authored by Mikołaj Zalewski's avatar Mikołaj Zalewski Committed by Alexandre Julliard

comctl32: rebar: Don't return rectangles with negative width or height in NCCalcSize.

parent a82b96f1
......@@ -4114,17 +4114,19 @@ inline static LRESULT
REBAR_NCCalcSize (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
HTHEME theme;
RECT *rect = (RECT *)lParam;
if (infoPtr->dwStyle & WS_BORDER) {
InflateRect((LPRECT)lParam, -GetSystemMetrics(SM_CXEDGE),
-GetSystemMetrics(SM_CYEDGE));
rect->left = min(rect->left + GetSystemMetrics(SM_CXEDGE), rect->right);
rect->right = max(rect->right - GetSystemMetrics(SM_CXEDGE), rect->left);
rect->top = min(rect->top + GetSystemMetrics(SM_CXEDGE), rect->bottom);
rect->bottom = max(rect->bottom - GetSystemMetrics(SM_CXEDGE), rect->top);
}
else if ((theme = GetWindowTheme (infoPtr->hwndSelf)))
{
((LPRECT)lParam)->top++;
rect->top = min(rect->top + 1, rect->bottom);
}
TRACE("new client=(%d,%d)-(%d,%d)\n",
((LPRECT)lParam)->left, ((LPRECT)lParam)->top,
((LPRECT)lParam)->right, ((LPRECT)lParam)->bottom);
TRACE("new client=(%d,%d)-(%d,%d)\n", rect->left, rect->top, rect->right, rect->bottom);
return 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment