Changeset 13115


Ignore:
Timestamp:
Dec 25, 2011, 10:15:13 PM (9 years ago)
Author:
livings124
Message:

make sure there's a screen before attempting to constrain info window size

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/InfoWindowController.m

    r13114 r13115  
    303303    if ([fViewController respondsToSelector: @selector(saveViewSize)]) //a little bit hacky, but avoids requiring an extra method
    304304    {
    305         const CGFloat screenHeight = NSHeight([[window screen] visibleFrame]);
    306         if (NSHeight(windowRect) > screenHeight)
     305        if ([window screen])
    307306        {
    308             const CGFloat difference = (screenHeight - NSHeight(windowRect)) * [window userSpaceScaleFactor];
    309             windowRect.origin.y -= difference;
    310             windowRect.size.height += difference;
    311            
    312             viewRect.size.height += difference;
     307            const CGFloat screenHeight = NSHeight([[window screen] visibleFrame]);
     308            if (NSHeight(windowRect) > screenHeight)
     309            {
     310                const CGFloat difference = (screenHeight - NSHeight(windowRect)) * [window userSpaceScaleFactor];
     311                windowRect.origin.y -= difference;
     312                windowRect.size.height += difference;
     313               
     314                viewRect.size.height += difference;
     315            }
    313316        }
    314317       
Note: See TracChangeset for help on using the changeset viewer.