Mac: Correct the y-axis position after 94af945dbb57
authorJørgen P. Tjernø <jorgenpt@gmail.com>
Thu, 24 Apr 2014 21:05:51 -0700
changeset 8738354dabd2cb58
parent 8737 0db0c21fd3ec
child 8739 153077041e4b
Mac: Correct the y-axis position after 94af945dbb57

This fixes a bug where we'd offset positions by the height of the dock, if it
was along the bottom of the screen.

Fixes https://bugzilla.libsdl.org/show_bug.cgi?id=2509
Thanks to Alex Szpakowski for bug & patch.
src/video/cocoa/SDL_cocoawindow.m
     1.1 --- a/src/video/cocoa/SDL_cocoawindow.m	Wed Apr 23 13:54:47 2014 -0700
     1.2 +++ b/src/video/cocoa/SDL_cocoawindow.m	Thu Apr 24 21:05:51 2014 -0700
     1.3 @@ -92,7 +92,7 @@
     1.4  static void ConvertNSRect(NSScreen *screen, NSRect *r)
     1.5  {
     1.6      NSRect visibleScreen = [screen visibleFrame];
     1.7 -    r->origin.y = visibleScreen.size.height - r->origin.y - r->size.height;
     1.8 +    r->origin.y = (visibleScreen.origin.y + visibleScreen.size.height) - r->origin.y - r->size.height;
     1.9  }
    1.10  
    1.11  static void