Commit 437235f9 authored by Sam Lantinga's avatar Sam Lantinga

Fixed mouse coordinates for fullscreen mode

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404249
parent 15a731ac
...@@ -232,17 +232,16 @@ static __inline__ void ConvertNSRect(NSRect *r) ...@@ -232,17 +232,16 @@ static __inline__ void ConvertNSRect(NSRect *r)
int index; int index;
SDL_Mouse *mouse; SDL_Mouse *mouse;
NSPoint point; NSPoint point;
NSRect rect;
index = _data->videodata->mouse; index = _data->videodata->mouse;
mouse = SDL_GetMouse(index); mouse = SDL_GetMouse(index);
point = [NSEvent mouseLocation]; point = [NSEvent mouseLocation];
if ( (window->flags & SDL_WINDOW_FULLSCREEN) ) { if ( (window->flags & SDL_WINDOW_FULLSCREEN) ) {
rect.size.width = CGDisplayPixelsWide(kCGDirectMainDisplay); NSRect rect = CGDisplayBounds(_data->display);
rect.size.height = CGDisplayPixelsHigh(kCGDirectMainDisplay);
point.x = point.x - rect.origin.x; point.x = point.x - rect.origin.x;
point.y = rect.size.height - point.y; point.y = CGDisplayPixelsHigh(kCGDirectMainDisplay) - point.y - rect.origin.y;
} else { } else {
point.x -= window->x; point.x -= window->x;
point.y = CGDisplayPixelsHigh(kCGDirectMainDisplay) - point.y - window->y; point.y = CGDisplayPixelsHigh(kCGDirectMainDisplay) - point.y - window->y;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment