Fixed annoying bug of the pieces view being black the first time it was shown.
This commit is contained in:
parent
a581a33a4e
commit
46d69d2d41
Binary file not shown.
|
@ -43,7 +43,7 @@
|
||||||
|
|
||||||
- (void) awakeFromNib
|
- (void) awakeFromNib
|
||||||
{
|
{
|
||||||
NSSize size = [fImageView frame].size;
|
NSSize size = [fImageView bounds].size;
|
||||||
NSBezierPath * bp = [NSBezierPath bezierPathWithRect: [fImageView bounds]];
|
NSBezierPath * bp = [NSBezierPath bezierPathWithRect: [fImageView bounds]];
|
||||||
|
|
||||||
//back image
|
//back image
|
||||||
|
@ -142,8 +142,8 @@
|
||||||
else
|
else
|
||||||
fAcross = MAX_ACROSS;
|
fAcross = MAX_ACROSS;
|
||||||
|
|
||||||
fWidth = ([[fImageView image] size].width - (fAcross + 1) * BETWEEN) / fAcross;
|
fWidth = ([fImageView bounds].size.width - (fAcross + 1) * BETWEEN) / fAcross;
|
||||||
fExtraBorder = ([[fImageView image] size].width - ((fWidth + BETWEEN) * fAcross + BETWEEN)) / 2;
|
fExtraBorder = ([fImageView bounds].size.width - ((fWidth + BETWEEN) * fAcross + BETWEEN)) / 2;
|
||||||
|
|
||||||
[self updateView: YES];
|
[self updateView: YES];
|
||||||
}
|
}
|
||||||
|
@ -157,11 +157,7 @@
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (first)
|
if (first)
|
||||||
{
|
[fImageView setImage: [[fBack copy] autorelease]];
|
||||||
NSImage * back = [fBack copy];
|
|
||||||
[fImageView setImage: back];
|
|
||||||
[back release];
|
|
||||||
}
|
|
||||||
NSImage * image = [fImageView image];
|
NSImage * image = [fImageView image];
|
||||||
|
|
||||||
int8_t * pieces = malloc(fNumPieces);
|
int8_t * pieces = malloc(fNumPieces);
|
||||||
|
@ -237,7 +233,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
point = NSMakePoint(j * (fWidth + BETWEEN) + BETWEEN + fExtraBorder,
|
point = NSMakePoint(j * (fWidth + BETWEEN) + BETWEEN + fExtraBorder,
|
||||||
[[fImageView image] size].width - (i + 1) * (fWidth + BETWEEN) - fExtraBorder);
|
[image size].width - (i + 1) * (fWidth + BETWEEN) - fExtraBorder);
|
||||||
[pieceImage compositeToPoint: point fromRect: rect operation: NSCompositeSourceOver];
|
[pieceImage compositeToPoint: point fromRect: rect operation: NSCompositeSourceOver];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue