mirror of
https://github.com/TermiT/Flycut.git
synced 2025-02-22 23:13:34 +08:00
22 lines
500 B
Mathematica
22 lines
500 B
Mathematica
|
//
|
||
|
// NSWindow+TrueCenter.m
|
||
|
// Jumpcut
|
||
|
//
|
||
|
// Created by Gennadii Potapov on 4/8/11.
|
||
|
// Copyright 2011 __MyCompanyName__. All rights reserved.
|
||
|
//
|
||
|
|
||
|
#import "NSWindow+TrueCenter.h"
|
||
|
|
||
|
@implementation NSWindow (TrueCenter)
|
||
|
|
||
|
- (void)trueCenter {
|
||
|
NSRect frame = [self frame];
|
||
|
NSRect screen = [[self screen] frame];
|
||
|
frame.origin.x = (screen.size.width - frame.size. width) / 2;
|
||
|
frame.origin.y = (screen.size.height - frame.size.height) / 2;
|
||
|
[self setFrameOrigin:frame.origin];
|
||
|
}
|
||
|
|
||
|
@end
|