From af9ec8f6b5e5ede0341e350689c751255ebfa817 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 13 Aug 2017 20:13:11 -0700 Subject: [PATCH] Fixed copy-paste error, thanks Alen! --- src/render/SDL_render.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c index 1955cb55f..ea8cfdfe6 100644 --- a/src/render/SDL_render.c +++ b/src/render/SDL_render.c @@ -187,10 +187,10 @@ SDL_RendererEventWatch(void *userdata, SDL_Event *event) event->type == SDL_MOUSEBUTTONUP) { SDL_Window *window = SDL_GetWindowFromID(event->button.windowID); if (renderer->logical_w && window == renderer->window) { - event->motion.x -= (int)(renderer->viewport.x * renderer->dpi_scale.x); - event->motion.y -= (int)(renderer->viewport.y * renderer->dpi_scale.y); - event->motion.x = (int)(event->motion.x / (renderer->scale.x * renderer->dpi_scale.x)); - event->motion.y = (int)(event->motion.y / (renderer->scale.y * renderer->dpi_scale.y)); + event->button.x -= (int)(renderer->viewport.x * renderer->dpi_scale.x); + event->button.y -= (int)(renderer->viewport.y * renderer->dpi_scale.y); + event->button.x = (int)(event->button.x / (renderer->scale.x * renderer->dpi_scale.x)); + event->button.y = (int)(event->button.y / (renderer->scale.y * renderer->dpi_scale.y)); } } return 0;