NSImageCell flip image if view flipped

This commit is contained in:
Christopher Lloyd 2011-01-20 21:52:59 -05:00
parent bf3e9bfef3
commit 3d5630fe81

View File

@ -171,7 +171,14 @@ static NSSize scaledImageSizeInFrameSize(NSSize imageSize,NSSize frameSize,NSIma
CGContextSaveGState(ctx);
CGContextClipToRect(ctx,frame);
frame=[self _scaledAndAlignedImageFrame:frame];
frame=[self _scaledAndAlignedImageFrame:frame];
if([control isFlipped]){
CGAffineTransform flip={1,0,0,-1,0,frame.size.height};
CGContextConcatCTM(ctx,flip);
}
[[self _imageValue] drawInRect:frame fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0];
CGContextRestoreGState(ctx);