src/events/SDL_mouse.c
changeset 5370 cb219a294ebf
parent 5262 b530ef003506
child 5371 fc3d3d580777
     1.1 --- a/src/events/SDL_mouse.c	Sun Feb 20 23:51:31 2011 -0800
     1.2 +++ b/src/events/SDL_mouse.c	Sun Feb 20 23:51:59 2011 -0800
     1.3 @@ -153,18 +153,22 @@
     1.4      }
     1.5  
     1.6      SDL_GetWindowSize(mouse->focus, &x_max, &y_max);
     1.7 +    --x_max;
     1.8 +    --y_max;
     1.9  
    1.10      /* make sure that the pointers find themselves inside the windows */
    1.11      /* only check if mouse->xmax is set ! */
    1.12 -    if (x_max && mouse->x > x_max) {
    1.13 +    if (mouse->x > x_max) {
    1.14          mouse->x = x_max;
    1.15 -    } else if (mouse->x < 0) {
    1.16 +    }
    1.17 +    if (mouse->x < 0) {
    1.18          mouse->x = 0;
    1.19      }
    1.20  
    1.21 -    if (y_max && mouse->y > y_max) {
    1.22 +    if (mouse->y > y_max) {
    1.23          mouse->y = y_max;
    1.24 -    } else if (mouse->y < 0) {
    1.25 +    }
    1.26 +    if (mouse->y < 0) {
    1.27          mouse->y = 0;
    1.28      }
    1.29