Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Adam Strzelecki to SDL
Browse files Browse the repository at this point in the history
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 c3708d1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/video/cocoa/SDL_cocoawindow.m
Expand Up @@ -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);
Expand All @@ -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) {
Expand Down

0 comments on commit c3708d1

Please sign in to comment.