Changeset 3189


Ignore:
Timestamp:
Sep 26, 2007, 5:42:45 PM (15 years ago)
Author:
livings124
Message:

remove the remaining extra drawing and use of non-integers in the regular bar

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/TorrentCell.m

    r3187 r3189  
    284284   
    285285    int leftWidth = barRect.size.width;
    286     float progress = [torrent progress], left = [torrent progressLeft];
     286    float progress = [torrent progress];
    287287   
    288288    if (progress < 1.0)
     
    291291        leftWidth -= rightWidth;
    292292       
    293         float rightProgress = 1.0 - progress;
    294         if (left < rightProgress)
    295         {
    296             int rightNoIncludeWidth = rightWidth * ((rightProgress - left) / rightProgress);
     293        float rightProgress = 1.0 - progress, progressLeft = [torrent progressLeft];
     294        if (progressLeft < rightProgress)
     295        {
     296            int rightNoIncludeWidth = rightWidth * ((rightProgress - progressLeft) / rightProgress);
    297297            rightWidth -= rightNoIncludeWidth;
    298298           
     
    334334            {
    335335                #warning integer-ize!
    336                 NSRect ratioRect = completeRect;
    337                 ratioRect.size.width *= [torrent progressStopRatio];
     336                /*NSRect ratioRect = completeRect;
     337                ratioRect.size.width *= [torrent progressStopRatio];*/
    338338               
    339                 if (ratioRect.size.width < completeRect.size.width)
     339                int ratioLeftWidth = leftWidth * (1.0 - [torrent progressStopRatio]);
     340                leftWidth -= ratioLeftWidth;
     341               
     342                if (ratioLeftWidth > 0)
    340343                {
     344                    NSRect ratioLeftRect = barRect;
     345                    ratioLeftRect.origin.x += leftWidth;
     346                    ratioLeftRect.size.width = ratioLeftWidth;
     347                   
    341348                    if (!fLightGreenGradient)
    342349                        fLightGreenGradient = [[CTGradient progressLightGreenGradient] retain];
    343                     [fLightGreenGradient fillRect: completeRect angle: -90];
     350                    [fLightGreenGradient fillRect: ratioLeftRect angle: -90];
    344351                }
    345352               
    346                 if (!fGreenGradient)
    347                     fGreenGradient = [[CTGradient progressGreenGradient] retain];
    348                 [fGreenGradient fillRect: ratioRect angle: -90];
     353                if (leftWidth > 0)
     354                {
     355                    completeRect.size.width = leftWidth;
     356                   
     357                    if (!fGreenGradient)
     358                        fGreenGradient = [[CTGradient progressGreenGradient] retain];
     359                    [fGreenGradient fillRect: completeRect angle: -90];
     360                }
    349361            }
    350362            else
     
    359371            if ([torrent waitingToStart])
    360372            {
    361                 if (left <= 0.0)
     373                if ([torrent progressLeft] <= 0.0)
    362374                {
    363375                    if (!fDarkGreenGradient)
Note: See TracChangeset for help on using the changeset viewer.