Changeset 9255


Ignore:
Timestamp:
Oct 9, 2009, 11:02:10 PM (13 years ago)
Author:
livings124
Message:

minimal efficiency change: when drawing on the torrent cell, don't copy the bound rect unnecessarily

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/TorrentCell.m

    r9241 r9255  
    697697- (NSRect) rectForMinimalStatusWithString: (NSAttributedString *) string inBounds: (NSRect) bounds
    698698{
    699     NSRect result = bounds;
     699    NSRect result;
     700    result.origin.x = NSMinX(bounds) + bounds.size.width - result.size.width - PADDING_HORIZONTAL;
     701    result.origin.y = NSMinY(bounds) + PADDING_ABOVE_MIN_STATUS;
     702   
    700703    result.size = [string size];
    701    
    702     result.origin.x += bounds.size.width - result.size.width - PADDING_HORIZONTAL;
    703     result.origin.y += PADDING_ABOVE_MIN_STATUS;
    704704   
    705705    return result;
     
    711711    const BOOL minimal = [fDefaults boolForKey: @"SmallView"];
    712712   
    713     NSRect result = bounds;
    714     result.origin.y += PADDING_ABOVE_TITLE;
    715     result.origin.x += PADDING_HORIZONTAL + (minimal ? IMAGE_SIZE_MIN : IMAGE_SIZE_REG) + PADDING_BETWEEN_IMAGE_AND_TITLE;
     713    NSRect result;
     714    result.origin.y = NSMinY(bounds) + PADDING_ABOVE_TITLE;
     715    result.origin.x = NSMinX(bounds) + PADDING_HORIZONTAL
     716                        + (minimal ? IMAGE_SIZE_MIN : IMAGE_SIZE_REG) + PADDING_BETWEEN_IMAGE_AND_TITLE;
    716717   
    717718    result.size = [string size];
     
    725726- (NSRect) rectForProgressWithString: (NSAttributedString *) string inBounds: (NSRect) bounds
    726727{
    727     NSRect result = bounds;
    728     result.origin.y += PADDING_ABOVE_TITLE + HEIGHT_TITLE + PADDING_BETWEEN_TITLE_AND_PROGRESS;
    729     result.origin.x += PADDING_HORIZONTAL + IMAGE_SIZE_REG + PADDING_BETWEEN_IMAGE_AND_TITLE;
     728    NSRect result;
     729    result.origin.y = NSMinY(bounds) + PADDING_ABOVE_TITLE + HEIGHT_TITLE + PADDING_BETWEEN_TITLE_AND_PROGRESS;
     730    result.origin.x = NSMinX(bounds) + PADDING_HORIZONTAL + IMAGE_SIZE_REG + PADDING_BETWEEN_IMAGE_AND_TITLE;
    730731   
    731732    result.size = [string size];
     
    737738- (NSRect) rectForStatusWithString: (NSAttributedString *) string inBounds: (NSRect) bounds
    738739{
    739     NSRect result = bounds;
    740     result.origin.y += PADDING_ABOVE_TITLE + HEIGHT_TITLE + PADDING_BETWEEN_TITLE_AND_PROGRESS + HEIGHT_STATUS
     740    NSRect result;
     741    result.origin.y = NSMinY(bounds) + PADDING_ABOVE_TITLE + HEIGHT_TITLE + PADDING_BETWEEN_TITLE_AND_PROGRESS + HEIGHT_STATUS
    741742                        + PADDING_BETWEEN_PROGRESS_AND_BAR + BAR_HEIGHT + PADDING_BETWEEN_BAR_AND_STATUS;
    742     result.origin.x += PADDING_HORIZONTAL + IMAGE_SIZE_REG + PADDING_BETWEEN_IMAGE_AND_TITLE;
     743    result.origin.x = NSMinX(bounds) + PADDING_HORIZONTAL + IMAGE_SIZE_REG + PADDING_BETWEEN_IMAGE_AND_TITLE;
    743744   
    744745    result.size = [string size];
  • trunk/macosx/TrackerNode.m

    r9254 r9255  
    137137{
    138138    NSString * dateString;
    139     if (fStat.hasScraped && fStat.lastScrapeTime != 0)
     139    if (fStat.hasScraped)
    140140    {
    141141        NSDateFormatter * dateFormatter = [[NSDateFormatter alloc] init];
Note: See TracChangeset for help on using the changeset viewer.