fix for window overlapping the menu bar if the user dragged it up there.

This commit is contained in:
Randall Luecke
2010-01-04 10:24:38 -05:00
committed by Ross Boucher
parent 09345a9d53
commit 5018df511b
+7 -1
View File
@@ -37,6 +37,7 @@ var _CPWindowViewResizeIndicatorImage = nil;
CPView _toolbarView;
// BOOL _isAnimatingToolbar;
_isFullPlatformWindow
CGRect _resizeFrame;
CGPoint _mouseDraggedPoint;
@@ -160,10 +161,15 @@ var _CPWindowViewResizeIndicatorImage = nil;
if (!visibleFrame)
visibleFrame = [[CPPlatformWindow primaryPlatformWindow] visibleFrame];
var minPointY = 0;
if([CPMenu menuBarVisible])
minPointY = [[CPApp mainMenu] menuBarHeight];
var restrictedPoint = CGPointMake(0, 0);
restrictedPoint.x = MIN(MAX(aPoint.x, -_frame.size.width + 4.0), CGRectGetMaxX(visibleFrame) - 4.0);
restrictedPoint.y = MIN(MAX(aPoint.y, 0.0), CGRectGetMaxY(visibleFrame) - 8.0);
restrictedPoint.y = MIN(MAX(aPoint.y, minPointY), CGRectGetMaxY(visibleFrame) - 8.0);
return restrictedPoint;
}