#4683 Info window swapped view heights not constrained to screen size

This commit is contained in:
Mitchell Livingston 2011-12-25 22:05:18 +00:00
parent a8468a7b09
commit 25a5834614
1 changed files with 11 additions and 1 deletions

View File

@ -296,12 +296,22 @@ typedef enum
NSRect windowRect = [window frame], viewRect = [view frame];
CGFloat difference = (NSHeight(viewRect) - oldHeight) * [window userSpaceScaleFactor];
const CGFloat difference = (NSHeight(viewRect) - oldHeight) * [window userSpaceScaleFactor];
windowRect.origin.y -= difference;
windowRect.size.height += difference;
if ([fViewController respondsToSelector: @selector(saveViewSize)]) //a little bit hacky, but avoids requiring an extra method
{
const CGFloat screenHeight = NSHeight([[window screen] visibleFrame]);
if (NSHeight(windowRect) > screenHeight)
{
const CGFloat difference = (screenHeight - NSHeight(windowRect)) * [window userSpaceScaleFactor];
windowRect.origin.y -= difference;
windowRect.size.height += difference;
viewRect.size.height += difference;
}
[window setMinSize: NSMakeSize([window minSize].width, NSHeight(windowRect) - NSHeight(viewRect) + TAB_MIN_HEIGHT)];
[window setMaxSize: NSMakeSize(FLT_MAX, FLT_MAX)];
}