src/video/cocoa/SDL_cocoamousetap.m
changeset 10159 d41acf6379f6
parent 10147 ddbdc9c1b92f
child 10177 faa36f2de933
     1.1 --- a/src/video/cocoa/SDL_cocoamousetap.m	Sun May 01 19:51:10 2016 -0300
     1.2 +++ b/src/video/cocoa/SDL_cocoamousetap.m	Sun May 01 21:41:30 2016 -0300
     1.3 @@ -96,7 +96,7 @@
     1.4      eventLocation = CGEventGetUnflippedLocation(event);
     1.5      windowRect = [nswindow contentRectForFrameRect:[nswindow frame]];
     1.6  
     1.7 -    if (!NSPointInRect(NSPointFromCGPoint(eventLocation), windowRect)) {
     1.8 +    if (!NSMouseInRect(NSPointFromCGPoint(eventLocation), windowRect, NO)) {
     1.9  
    1.10          /* This is in CGs global screenspace coordinate system, which has a
    1.11           * flipped Y.
    1.12 @@ -109,10 +109,10 @@
    1.13              newLocation.x = NSMaxX(windowRect) - 1.0;
    1.14          }
    1.15  
    1.16 -        if (eventLocation.y < NSMinY(windowRect)) {
    1.17 +        if (eventLocation.y <= NSMinY(windowRect)) {
    1.18              newLocation.y -= (NSMinY(windowRect) - eventLocation.y + 1);
    1.19 -        } else if (eventLocation.y >= NSMaxY(windowRect)) {
    1.20 -            newLocation.y += (eventLocation.y - NSMaxY(windowRect) + 1);
    1.21 +        } else if (eventLocation.y > NSMaxY(windowRect)) {
    1.22 +            newLocation.y += (eventLocation.y - NSMaxY(windowRect));
    1.23          }
    1.24  
    1.25          CGWarpMouseCursorPosition(newLocation);