src/render/SDL_render.c
changeset 7496 13dfa871f0af
parent 7419 a22566f42281
child 7508 1f64c6874619
     1.1 --- a/src/render/SDL_render.c	Sun Jul 21 12:47:47 2013 -0700
     1.2 +++ b/src/render/SDL_render.c	Sun Jul 21 12:54:27 2013 -0700
     1.3 @@ -151,6 +151,16 @@
     1.4              event->motion.y -= renderer->viewport.y;
     1.5              event->motion.x = (int)(event->motion.x / renderer->scale.x);
     1.6              event->motion.y = (int)(event->motion.y / renderer->scale.y);
     1.7 +            if (event->motion.xrel > 0) {
     1.8 +                event->motion.xrel = SDL_max(1, (int)(event->motion.xrel / renderer->scale.x));
     1.9 +            } else if (event->motion.xrel < 0) {
    1.10 +                event->motion.xrel = SDL_min(-1, (int)(event->motion.xrel / renderer->scale.x));
    1.11 +            }
    1.12 +            if (event->motion.yrel > 0) {
    1.13 +                event->motion.yrel = SDL_max(1, (int)(event->motion.yrel / renderer->scale.y));
    1.14 +            } else if (event->motion.yrel < 0) {
    1.15 +                event->motion.yrel = SDL_min(-1, (int)(event->motion.yrel / renderer->scale.y));
    1.16 +            }
    1.17          }
    1.18      } else if (event->type == SDL_MOUSEBUTTONDOWN ||
    1.19                 event->type == SDL_MOUSEBUTTONUP) {