Commit cf7ca27b authored by Sam Lantinga's avatar Sam Lantinga

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 @@)

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404138
parent f9c1667f
...@@ -233,7 +233,7 @@ static __inline__ void ConvertNSRect(NSRect *r) ...@@ -233,7 +233,7 @@ static __inline__ void ConvertNSRect(NSRect *r)
int index; int index;
SDL_Mouse *mouse; SDL_Mouse *mouse;
NSPoint point; NSPoint point;
NSRect rect = [_data->window contentRectForFrameRect:[_data->window frame]]; NSRect rect;
index = _data->videodata->mouse; index = _data->videodata->mouse;
mouse = SDL_GetMouse(index); mouse = SDL_GetMouse(index);
...@@ -242,14 +242,12 @@ static __inline__ void ConvertNSRect(NSRect *r) ...@@ -242,14 +242,12 @@ static __inline__ void ConvertNSRect(NSRect *r)
if ( (window->flags & SDL_WINDOW_FULLSCREEN) ) { if ( (window->flags & SDL_WINDOW_FULLSCREEN) ) {
rect.size.width = CGDisplayPixelsWide(kCGDirectMainDisplay); rect.size.width = CGDisplayPixelsWide(kCGDirectMainDisplay);
rect.size.height = CGDisplayPixelsHigh(kCGDirectMainDisplay); rect.size.height = CGDisplayPixelsHigh(kCGDirectMainDisplay);
point.x = point.x - rect.origin.x;
point.y = rect.size.height - point.y; point.y = rect.size.height - point.y;
} else { } else {
rect = [_data->window contentRectForFrameRect:[_data->window frame]]; 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.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 || if ( point.x < 0 || point.x >= rect.size.width ||
point.y < 0 || point.y >= rect.size.height ) { point.y < 0 || point.y >= rect.size.height ) {
if (mouse->focus != 0) { if (mouse->focus != 0) {
......
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