[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    Re: tab: Shift selected tab text up instead of down [RESEND]
From:       Mike McCormack <mike () codeweavers ! com>
Date:       2005-05-31 4:57:56
Message-ID: 429BEED4.1040802 () codeweavers ! com
[Download RAW message or body]


> +        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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic