Fixed copy-paste error, thanks Alen!
authorSam Lantinga
Sun, 13 Aug 2017 20:13:11 -0700
changeset 11264d631b3dac8be
parent 11263 f85618f8ba81
child 11265 9152aa462a82
Fixed copy-paste error, thanks Alen!
src/render/SDL_render.c
     1.1 --- a/src/render/SDL_render.c	Sun Aug 13 18:12:06 2017 -0700
     1.2 +++ b/src/render/SDL_render.c	Sun Aug 13 20:13:11 2017 -0700
     1.3 @@ -187,10 +187,10 @@
     1.4                 event->type == SDL_MOUSEBUTTONUP) {
     1.5          SDL_Window *window = SDL_GetWindowFromID(event->button.windowID);
     1.6          if (renderer->logical_w && window == renderer->window) {
     1.7 -            event->motion.x -= (int)(renderer->viewport.x * renderer->dpi_scale.x);
     1.8 -            event->motion.y -= (int)(renderer->viewport.y * renderer->dpi_scale.y);
     1.9 -            event->motion.x = (int)(event->motion.x / (renderer->scale.x * renderer->dpi_scale.x));
    1.10 -            event->motion.y = (int)(event->motion.y / (renderer->scale.y * renderer->dpi_scale.y));
    1.11 +            event->button.x -= (int)(renderer->viewport.x * renderer->dpi_scale.x);
    1.12 +            event->button.y -= (int)(renderer->viewport.y * renderer->dpi_scale.y);
    1.13 +            event->button.x = (int)(event->button.x / (renderer->scale.x * renderer->dpi_scale.x));
    1.14 +            event->button.y = (int)(event->button.y / (renderer->scale.y * renderer->dpi_scale.y));
    1.15          }
    1.16      }
    1.17      return 0;