Skip to content

Commit c6ee313

Browse files
committed
(#3) Inverted coordinates on macOS
1 parent 62f1999 commit c6ee313

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/highlightwindow_macos.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ void showHighlightWindow(int x, int y, int width, int height, int duration, floa
55
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
66
[NSApplication sharedApplication];
77

8-
NSRect frame = NSMakeRect(x, y, width, height);
8+
NSRect mainScreenFrameRect = [[NSScreen mainScreen] frame];
9+
CGFloat screenHeight = mainScreenFrameRect.size.height;
10+
NSRect frame = NSMakeRect(x, screenHeight - y - height, width, height);
911
NSUInteger styleMask = NSWindowStyleMaskBorderless;
1012
NSWindow * window = [[[NSWindow alloc] initWithContentRect:frame styleMask:styleMask backing:NSBackingStoreBuffered defer:NO] autorelease];
1113
[window setBackgroundColor:[NSColor redColor]];

0 commit comments

Comments
 (0)