Changeset 6360

Show
Ignore:
Timestamp:
11/29/08 15:15:14 (1 month ago)
Author:
morris
Message:

If size is less than min size, try to resize to a bit bigger while keeping aspect ratio

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Spiral/SPPlayerController.m

    r5519 r6360  
    114114                        minSize = [[self window] minSize]; 
    115115                         
     116                        if(size.width < minSize.width) { 
     117                                size.width                      = minSize.width; 
     118                                size.height                     = floor(size.width / aspectRatio) + heightDifference; 
     119                        } 
     120                        else if(size.height < minSize.height) { 
     121                                size.height                     = minSize.height; 
     122                                size.width                      = floor((size.height - heightDifference) / (1.0 / aspectRatio)); 
     123                        } 
     124 
    116125                        if(size.width < minSize.width || size.height < minSize.height) 
    117126                                size = minSize;