Changeset 970


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

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Transmission.xcodeproj/project.pbxproj

    r956 r970  
    288288                4DCCBB3C09C3D71100D3CABF /* TorrentCell.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = TorrentCell.m; path = macosx/TorrentCell.m; sourceTree = "<group>"; };
    289289                4DCCBB3D09C3D71100D3CABF /* TorrentCell.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = TorrentCell.h; path = macosx/TorrentCell.h; sourceTree = "<group>"; };
    290                 4DDBB71909E16BAE00284745 /* transmissioncli */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = transmissioncli; sourceTree = BUILT_PRODUCTS_DIR; };
     290                4DDBB71909E16BAE00284745 /* transmissioncli */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "compiled.mach-o.executable"; path = transmissioncli; sourceTree = BUILT_PRODUCTS_DIR; };
    291291                4DDBB71B09E16BF100284745 /* transmissioncli.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = transmissioncli.c; path = cli/transmissioncli.c; sourceTree = "<group>"; };
    292292                4DDFDD20099A5D8E00189D81 /* DownloadBadge.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = DownloadBadge.png; path = macosx/Images/DownloadBadge.png; sourceTree = "<group>"; };
  • 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.