From 02293c46a8552aa8f28b02a4e2ac66fa1486b3a1 Mon Sep 17 00:00:00 2001 From: IntelOrca Date: Sun, 24 Aug 2014 17:52:17 +0100 Subject: [PATCH] fixes #357, glitchy viewport dragging --- src/game.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/game.c b/src/game.c index 5176330499..c14fb057d0 100644 --- a/src/game.c +++ b/src/game.c @@ -792,9 +792,12 @@ static void game_handle_input_mouse(int x, int y, int state) case INPUT_STATE_VIEWPORT_DRAG: { int dx, dy; + + POINT newDragPosition; + GetCursorPos(&newDragPosition); - dx = x - RCT2_GLOBAL(RCT2_ADDRESS_CURSOR_DRAG_LAST_X, sint16); - dy = y - RCT2_GLOBAL(RCT2_ADDRESS_CURSOR_DRAG_LAST_Y, sint16); + dx = newDragPosition.x - _dragPosition.x; + dy = newDragPosition.y - _dragPosition.y; w = window_find_by_id(RCT2_GLOBAL(RCT2_ADDRESS_CURSOR_DRAG_WINDOWCLASS, rct_windowclass), RCT2_GLOBAL(RCT2_ADDRESS_CURSOR_DRAG_WINDOWNUMBER, rct_windownumber)); if (state == 0) { rct_viewport *viewport = w->viewport;