Changeset 979


Ignore:
Timestamp:
Oct 4, 2006, 7:53:26 PM (15 years ago)
Author:
livings124
Message:

Fixed annoying bug of the pieces view being black the first time it was shown.

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/PiecesView.m

    r978 r979  
    4444- (void) awakeFromNib
    4545{
    46         NSSize size = [fImageView frame].size;
     46        NSSize size = [fImageView bounds].size;
    4747        NSBezierPath * bp = [NSBezierPath bezierPathWithRect: [fImageView bounds]];
    4848       
     
    143143            fAcross = MAX_ACROSS;
    144144       
    145         fWidth = ([[fImageView image] size].width - (fAcross + 1) * BETWEEN) / fAcross;
    146         fExtraBorder = ([[fImageView image] size].width - ((fWidth + BETWEEN) * fAcross + BETWEEN)) / 2;
     145        fWidth = ([fImageView bounds].size.width - (fAcross + 1) * BETWEEN) / fAcross;
     146        fExtraBorder = ([fImageView bounds].size.width - ((fWidth + BETWEEN) * fAcross + BETWEEN)) / 2;
    147147       
    148148        [self updateView: YES];
     
    158158   
    159159    if (first)
    160     {
    161         NSImage * back = [fBack copy];
    162         [fImageView setImage: back];
    163         [back release];
    164     }
     160        [fImageView setImage: [[fBack copy] autorelease]];
    165161    NSImage * image = [fImageView image];
    166162   
     
    238234               
    239235                point = NSMakePoint(j * (fWidth + BETWEEN) + BETWEEN + fExtraBorder,
    240                                     [[fImageView image] size].width - (i + 1) * (fWidth + BETWEEN) - fExtraBorder);
     236                                    [image size].width - (i + 1) * (fWidth + BETWEEN) - fExtraBorder);
    241237                [pieceImage compositeToPoint: point fromRect: rect operation: NSCompositeSourceOver];
    242238            }
Note: See TracChangeset for help on using the changeset viewer.