From: Kent Sutherland Date: Mon, 20 Dec 2004 00:53:52 +0000 (+0000) Subject: Fixed multi-monitorness except with Pivot, which is only half fixed. X-Git-Tag: v1.0~7 X-Git-Url: http://git.ithinksw.org/ITKit.git/commitdiff_plain/676d1feebedb6b04b4da4bb58b3ca1282d7740f5 Fixed multi-monitorness except with Pivot, which is only half fixed. --- diff --git a/ITPivotWindowEffect.m b/ITPivotWindowEffect.m index 400d931..3b0c5a4 100755 --- a/ITPivotWindowEffect.m +++ b/ITPivotWindowEffect.m @@ -203,14 +203,15 @@ { int hPos = [_window horizontalPosition]; int vPos = [_window verticalPosition]; + NSRect winFrame = [_window frame]; if ( (hPos == ITWindowPositionCenter) || (vPos == ITWindowPositionMiddle) ) { CGAffineTransform transform; NSPoint translation; - 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 = CGAffineTransformMakeTranslation( translation.x, translation.y ); @@ -220,7 +221,6 @@ } else { float degAngle; - NSRect windowFrame = [_window frame]; NSRect screenFrame = [[_window screen] frame]; float translateX = 0; float translateY = 0; @@ -242,23 +242,22 @@ degAngle = (angle * (pi / 180)); transform = CGAffineTransformMakeRotation(degAngle); - if ( vPos == ITWindowPositionBottom ) { - transform.ty = ( windowFrame.size.height + windowFrame.origin.y); + transform.ty = ( winFrame.size.height + winFrame.origin.y) + (screenFrame.size.height - [[NSScreen mainScreen] frame].size.height); translateY = -(screenFrame.size.height); } else if ( vPos == ITWindowPositionTop ) { - transform.ty = -( screenFrame.size.height - windowFrame.origin.y - windowFrame.size.height ); + transform.ty = winFrame.origin.y + winFrame.size.height - [[NSScreen mainScreen] frame].size.height; translateY = 0; } if ( hPos == ITWindowPositionLeft ) { - transform.tx = -( windowFrame.origin.x ); + transform.tx = -( winFrame.origin.x ); translateX = 0; } else if ( hPos == ITWindowPositionRight ) { - transform.tx = ( screenFrame.size.width - windowFrame.origin.x ); + //transform.tx = ( screenFrame.size.width - winFrame.origin.x ); + transform.tx = ( screenFrame.size.width - winFrame.origin.x ); translateX = -(screenFrame.size.width); } - CGSSetWindowTransform([NSApp contextID], (CGSWindowID)[_window windowNumber], CGAffineTransformTranslate( transform, diff --git a/ITSlideHorizontallyWindowEffect.m b/ITSlideHorizontallyWindowEffect.m index 1a26d1f..60122fd 100755 --- a/ITSlideHorizontallyWindowEffect.m +++ b/ITSlideHorizontallyWindowEffect.m @@ -187,16 +187,17 @@ { CGAffineTransform transform; NSPoint translation; - + NSRect winFrame = [_window frame]; + if ( [_window horizontalPosition] == ITWindowPositionLeft ) { - translation.x = ( -([_window frame].origin.x) + distance ) ; + translation.x = ( -(winFrame.origin.x) + distance ) ; } else if ( [_window horizontalPosition] == ITWindowPositionRight ) { - translation.x = ( -([_window frame].origin.x) - distance ) ; + translation.x = ( -(winFrame.origin.x) - distance ) ; } else { - translation.x = ( -([_window frame].origin.x) ) ; + translation.x = ( -(winFrame.origin.x) ) ; } - translation.y = -( [[_window screen] frame].size.height - [_window frame].origin.y - [_window frame].size.height ); + translation.y = winFrame.origin.y + winFrame.size.height - [[NSScreen mainScreen] frame].size.height; transform = CGAffineTransformMakeTranslation( translation.x, translation.y ); diff --git a/ITSlideVerticallyWindowEffect.m b/ITSlideVerticallyWindowEffect.m index 7237620..1f60933 100755 --- a/ITSlideVerticallyWindowEffect.m +++ b/ITSlideVerticallyWindowEffect.m @@ -187,15 +187,16 @@ { CGAffineTransform transform; NSPoint translation; + NSRect winFrame = [_window frame]; translation.x = -( [_window frame].origin.x ); if ( [_window verticalPosition] == ITWindowPositionTop ) { - translation.y = ( (([_window frame].size.height * 2) - ([[_window screen] frame].size.height - [_window frame].origin.y)) - distance); + translation.y = (winFrame.size.height * 2) - ([[NSScreen mainScreen] frame].size.height - winFrame.origin.y) - distance; } else if ( [_window verticalPosition] == ITWindowPositionBottom ) { - translation.y = -( [[_window screen] frame].size.height - [_window frame].origin.y - distance ); + translation.y = winFrame.origin.y + distance - [[NSScreen mainScreen] frame].size.height; } else { - translation.y = -( [[_window screen] frame].size.height - [_window frame].origin.y - [_window frame].size.height ); + translation.y = winFrame.origin.y + winFrame.size.height - [[NSScreen mainScreen] frame].size.height; } transform = CGAffineTransformMakeTranslation( translation.x, translation.y ); diff --git a/ITSpinAndZoomWindowEffect.m b/ITSpinAndZoomWindowEffect.m index cbbf44c..44b3ad3 100755 --- a/ITSpinAndZoomWindowEffect.m +++ b/ITSpinAndZoomWindowEffect.m @@ -193,28 +193,20 @@ - (void)setScale:(float)scale angle:(float)angle { - //int hPos = [_window horizontalPosition]; float radAngle = (angle * 4 * pi); CGAffineTransform transform; NSPoint translation; - NSRect screenFrame = [[_window screen] frame]; - - translation.x = /*screenFrame.origin.x + */([_window frame].size.width / 2.0); - translation.y = /*screenFrame.origin.y + */([_window frame].size.height / 2.0); + NSRect winFrame = [_window frame]; + + 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 / scale, 1.0 / scale); 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.x = -[_window frame].origin.x; - translation.y = -( screenFrame.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], diff --git a/ITSpinWindowEffect.m b/ITSpinWindowEffect.m index ef8aaf6..0de4f56 100755 --- 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.x = -[_window frame].origin.x; - translation.y = -( screenFrame.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], diff --git a/ITZoomWindowEffect.m b/ITZoomWindowEffect.m index b4a0778..bde7a2d 100755 --- a/ITZoomWindowEffect.m +++ b/ITZoomWindowEffect.m @@ -193,26 +193,18 @@ - (void)setZoom:(float)Zoom { - //int hPos = [_window horizontalPosition]; 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 = 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.x = -[_window frame].origin.x; - translation.y = -( screenFrame.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);