Mercurial > sdl-ios-xcode
comparison src/video/SDL_cursor.c @ 113:e21ac1dd30f1
Fixed crash if mouse is outside of the screen bounds for some reason
author | Sam Lantinga <slouken@lokigames.com> |
---|---|
date | Wed, 18 Jul 2001 20:08:18 +0000 |
parents | 1e7e61b9b0f9 |
children | e8157fcb3114 |
comparison
equal
deleted
inserted
replaced
112:9ef74357a5fb | 113:e21ac1dd30f1 |
---|---|
346 area->h += area->y; | 346 area->h += area->y; |
347 area->y = 0; | 347 area->y = 0; |
348 } | 348 } |
349 clip_diff = (area->x+area->w)-SDL_VideoSurface->w; | 349 clip_diff = (area->x+area->w)-SDL_VideoSurface->w; |
350 if ( clip_diff > 0 ) { | 350 if ( clip_diff > 0 ) { |
351 area->w -= clip_diff; | 351 area->w = area->w < clip_diff ? 0 : area->w-clip_diff; |
352 } | 352 } |
353 clip_diff = (area->y+area->h)-SDL_VideoSurface->h; | 353 clip_diff = (area->y+area->h)-SDL_VideoSurface->h; |
354 if ( clip_diff > 0 ) { | 354 if ( clip_diff > 0 ) { |
355 area->h -= clip_diff; | 355 area->h = area->h < clip_diff ? 0 : area->h-clip_diff; |
356 } | 356 } |
357 } | 357 } |
358 | 358 |
359 static void SDL_DrawCursorFast(SDL_Surface *screen, SDL_Rect *area) | 359 static void SDL_DrawCursorFast(SDL_Surface *screen, SDL_Rect *area) |
360 { | 360 { |