![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIVtAo7x3b4qOyw0x71-gqT_IHx7_NHx99QUNLwQrgObYAb46cITtKFlgH437p6_3xy7HYIwYRVQf7SIK7ihrrmwyht2Hg8ZgbT76tThJmNlTnKMSbFfMPzWM-BIQ4GgYdxpb7h6wEqdI/s320/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2012-02-25+9.52.01.png)
- (NSRect)imageFrame
{
NSRect imageFrame;
NSRect frame;
CGFloat maxHeight;
CGFloat ratio;
// Work around code for Mac OS X 10.7.x Lion's bug.
frame = [super frame];
imageFrame = [super imageFrame];
maxHeight = NSHeight(frame) - 20;
if(NSWidth(imageFrame) > maxHeight) {
ratio = maxHeight / NSWidth(imageFrame);
imageFrame.size = NSMakeSize(maxHeight, NSHeight(imageFrame) * ratio);
imageFrame.origin = NSMakePoint(NSMidX(frame) - NSWidth(imageFrame) / 2,
NSMidY(frame) - NSHeight(imageFrame) / 2 + 10);
}
return imageFrame;
}
0 件のコメント:
コメントを投稿