Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Adam Strzelecki to SDL

I think something is wrong (look at the fix patch below):
(1) NSRect rect shouldn't be initialized with contentRectForFrameRect: at the top of the function, contentRectForFrameRect is called in non-fullscreen case anyway (1st @@)
(2) I think you've left two lines that should be removed completely (2nd @@)
  • Loading branch information
slouken committed Oct 23, 2009
1 parent eeeab02 commit c3708d1ab58bf6ea898ce3f35c6d8de4059034e5
Showing with 2 additions and 4 deletions.
  1. +2 −4 src/video/cocoa/SDL_cocoawindow.m
@@ -233,7 +233,7 @@ - (void)mouseMoved:(NSEvent *)theEvent
int index;
SDL_Mouse *mouse;
NSPoint point;
NSRect rect = [_data->window contentRectForFrameRect:[_data->window frame]];
NSRect rect;

index = _data->videodata->mouse;
mouse = SDL_GetMouse(index);
@@ -242,14 +242,12 @@ - (void)mouseMoved:(NSEvent *)theEvent
if ( (window->flags & SDL_WINDOW_FULLSCREEN) ) {
rect.size.width = CGDisplayPixelsWide(kCGDirectMainDisplay);
rect.size.height = CGDisplayPixelsHigh(kCGDirectMainDisplay);
point.x = point.x - rect.origin.x;
point.y = rect.size.height - point.y;
} else {
rect = [_data->window contentRectForFrameRect:[_data->window frame]];
point.x = point.x - rect.origin.x;
point.y = rect.size.height - (point.y - rect.origin.y);
}
point.x = point.x - rect.origin.x;
point.y = rect.size.height - (point.y - rect.origin.y);
if ( point.x < 0 || point.x >= rect.size.width ||
point.y < 0 || point.y >= rect.size.height ) {
if (mouse->focus != 0) {

0 comments on commit c3708d1

Please sign in to comment.