mirror of
https://github.com/joel16/SDL2.git
synced 2024-12-13 05:58:37 +00:00
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:
parent
37aa008a3e
commit
890d033735
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user