comctl32: rebar: don't return rectangles with negative width or height in NCCalcSize (fixes bug #3797)

Vitaliy Margolen wine-devel at kievinfo.com
Mon Oct 16 20:26:33 CDT 2006


Mikołaj Zalewski wrote:
> CreateWindow doesn't like them
>
>      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);
Looks like a typo to me. You used SM_CXEDGE 4 times

Vitaliy



More information about the wine-devel mailing list