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
This commit is contained in:
Sam Lantinga 2001-07-18 20:08:18 +00:00
parent 37aa008a3e
commit 890d033735

View File

@ -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;
}
}