{
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 );
} else {
float degAngle;
- NSRect windowFrame = [_window frame];
NSRect screenFrame = [[_window screen] frame];
float translateX = 0;
float translateY = 0;
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,
{
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 );
{
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 );
- (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],
- (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],
- (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);