From 9d5827520a1080f218ce30a17c057c90db53d045 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Tue, 31 May 2016 23:03:31 +0200 Subject: [PATCH] Replace shifting with multiplication when dragging (#3789) `dx`, `dy` can be signed negative values, shifting them left is undefined. --- src/input.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/input.c b/src/input.c index a1416759c3..eb8a79b233 100644 --- a/src/input.c +++ b/src/input.c @@ -553,8 +553,8 @@ static void input_viewport_drag_continue() // As the user moved the mouse, don't interpret it as right click in any case. _ticksSinceDragStart = 1000; - dx <<= viewport->zoom + 1; - dy <<= viewport->zoom + 1; + dx *= 1 << (viewport->zoom + 1); + dy *= 1 << (viewport->zoom + 1); if (gConfigGeneral.invert_viewport_drag){ w->saved_view_x -= dx; w->saved_view_y -= dy;