Changeset 1676


Ignore:
Timestamp:
Apr 6, 2007, 3:15:53 PM (15 years ago)
Author:
livings124
Message:

don't draw for ratio < 0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/TorrentCell.m

    r1645 r1676  
    9898
    9999    width -= 2.0;
    100    
    101     BOOL seeding = [[info objectForKey: @"Seeding"] boolValue],
    102         isActive = [[info objectForKey: @"Active"] boolValue];
    103100    float completedWidth, remainingWidth;
    104101   
    105102    //bar images and widths
    106103    NSImage * barLeftEnd, * barRightEnd, * barComplete, * barRemaining;
    107     if (seeding)
     104    if ([[info objectForKey: @"Seeding"] boolValue])
    108105    {
    109106        float stopRatio, ratio;
    110107        if ((stopRatio = [[info objectForKey: @"StopRatio"] floatValue]) != INVALID
    111108                && (ratio = [[info objectForKey: @"Ratio"] floatValue]) < stopRatio)
     109                {
     110                        if (ratio < 0)
     111                                ratio = 0;
    112112            completedWidth = width * ratio / stopRatio;
     113                }
    113114        else
    114115            completedWidth = width;
     
    125126        remainingWidth = width - completedWidth;
    126127       
     128                BOOL isActive = [[info objectForKey: @"Active"] boolValue];
     129               
    127130        if (remainingWidth == width)
    128131            barLeftEnd = fProgressEndWhite;
Note: See TracChangeset for help on using the changeset viewer.