mirror of
https://github.com/TermiT/Flycut.git
synced 2025-02-21 22:43:15 +08:00
21 lines
500 B
Objective-C
21 lines
500 B
Objective-C
//
|
|
// 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
|