tab: Shift selected tab text up instead of down [RESEND]

Mike McCormack mike at codeweavers.com
Mon May 30 23:57:56 CDT 2005


> +        if (iItem == infoPtr->iSelected)
> +            center_offset_v = ((drawRect->bottom - drawRect->top) - (rcText.bottom - rcText.top) - infoPtr->uVItemPadding) / 2;
> +        else
> +            center_offset_v = ((drawRect->bottom - drawRect->top) - (rcText.bottom - rcText.top) + infoPtr->uVItemPadding) / 2;

Wouldn't it be clearer as:

     center_offset_v = (drawRect->bottom - drawRect->top) +
                       (rcText.bottom - rcText.top);
     if (iItem == infoPtr->iSelected)
         center_offset_v -= infoPtr->uVItemPadding;
     else
         center_offset_v += infoPtr->uVItemPadding;
     center_offset_v /= 2;

That breaks up the long lines, and eliminates the common sub-expressions...

Mike



More information about the wine-devel mailing list