Commit 890d0337 authored by Sam Lantinga's avatar Sam Lantinga

Fixed crash if mouse is outside of the screen bounds for some reason

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40114
parent 37aa008a
......@@ -348,11 +348,11 @@ void SDL_MouseRect(SDL_Rect *area)
}
clip_diff = (area->x+area->w)-SDL_VideoSurface->w;
if ( clip_diff > 0 ) {
area->w -= clip_diff;
area->w = area->w < clip_diff ? 0 : area->w-clip_diff;
}
clip_diff = (area->y+area->h)-SDL_VideoSurface->h;
if ( clip_diff > 0 ) {
area->h -= clip_diff;
area->h = area->h < clip_diff ? 0 : area->h-clip_diff;
}
}
......
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