Changeset 970 for trunk/macosx


Ignore:
Timestamp:
Oct 1, 2006, 4:12:46 PM (15 years ago)
Author:
livings124
Message:

changed around pieces view drawing code...still can't track down the bug of the view always first being black

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/PiecesView.m

    r969 r970  
    136136        //determine relevant values
    137137        fNumPieces = MAX_ACROSS * MAX_ACROSS;
    138         if ([fTorrent pieceCount] < fNumPieces)
     138        int pieceCount = [fTorrent pieceCount];
     139        if (pieceCount < fNumPieces)
    139140        {
    140             fNumPieces = [fTorrent pieceCount];
     141            fNumPieces = pieceCount;
    141142           
    142143            fAcross = sqrt(fNumPieces);
     
    161162        return;
    162163   
    163     if (first)
    164         [fImageView setImage: [[fBack copy] autorelease]];
    165    
    166     NSImage * image = [fImageView image];
     164    NSImage * image = first ? [fBack copy] : [fImageView image];
    167165   
    168166    int8_t * pieces = malloc(fNumPieces);
     
    180178            index++;
    181179            if (index >= fNumPieces)
     180            {
     181                i = fAcross;
    182182                break;
     183            }
    183184           
    184185            pieceImage = nil;
     
    244245    {
    245246        [image unlockFocus];
    246         [fImageView setNeedsDisplay];
     247   
     248        if (first)
     249        {
     250            [fImageView setImage: image];
     251            [image release];
     252        }
     253        else
     254            [fImageView setNeedsDisplay];
    247255    }
    248256   
Note: See TracChangeset for help on using the changeset viewer.