X-Git-Url: http://git.ithinksw.org/ITKit.git/blobdiff_plain/5a5f8385d7cf8bca82ac4bafe96d1dd313a1bc24..650aa30b6ac73ecb0727ec4409f02bf90adf51f5:/ITSpinWindowEffect.m diff --git a/ITSpinWindowEffect.m b/ITSpinWindowEffect.m old mode 100755 new mode 100644 index ad1b8aa..0de4f56 --- a/ITSpinWindowEffect.m +++ b/ITSpinWindowEffect.m @@ -193,27 +193,19 @@ - (void)setSpin:(float)progress { - int hPos = [_window horizontalPosition]; float radAngle = (progress * 4 * pi); CGAffineTransform transform; NSPoint translation; - NSRect screenFrame = [[_window screen] frame]; + NSRect winFrame = [_window frame]; - 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 = CGAffineTransformRotate(transform, radAngle); 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); CGSSetWindowTransform([NSApp contextID],