X-Git-Url: http://git.ithinksw.org/ITKit.git/blobdiff_plain/ee17fc263ed710648cfc5950a5bd603f8acacda2..99f5b6f0f00956827c1168857d67f5a27958db98:/ITZoomWindowEffect.m diff --git a/ITZoomWindowEffect.m b/ITZoomWindowEffect.m old mode 100755 new mode 100644 index e80735f..888e37a --- a/ITZoomWindowEffect.m +++ b/ITZoomWindowEffect.m @@ -54,7 +54,7 @@ - (void)performAppear { __idle = NO; - + [self setWindowVisibility:ITWindowAppearingState]; [self performAppearFromProgress:0.0 effectTime:_effectTime]; } @@ -193,26 +193,20 @@ - (void)setZoom:(float)Zoom { - int hPos = [_window horizontalPosition]; CGAffineTransform transform; NSPoint translation; - NSRect screenFrame = [[_window screen] frame]; + NSRect winFrame = [_window frame]; + + Zoom = MAX(Zoom, 0.000001); - translation.x = screenFrame.origin.x + ([_window frame].size.width / 2.0); - translation.y = screenFrame.origin.y + ([_window frame].size.height / 2.0); + translation.x = (winFrame.size.width / 2.0); + translation.y = (winFrame.size.height / 2.0); transform = CGAffineTransformMakeTranslation(translation.x, translation.y); transform = CGAffineTransformScale(transform, 1.0 / Zoom, 1.0 / Zoom); transform = CGAffineTransformTranslate(transform, -translation.x, -translation.y); - if (hPos == ITWindowPositionLeft) { - translation.x = -[_window frame].origin.x; - } else if (hPos == ITWindowPositionRight) { - translation.x = -[_window frame].origin.x; - } else { - translation.x = -[_window frame].origin.x; - } - - translation.y = -( [[_window screen] frame].size.height - [_window frame].origin.y - [_window frame].size.height ); + translation.x = -winFrame.origin.x; + translation.y = winFrame.origin.y + winFrame.size.height - [[NSScreen mainScreen] frame].size.height; transform = CGAffineTransformTranslate(transform, translation.x, translation.y);