From 630346855535d32c7686aae83f9612f5ae39c4da Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Fri, 14 Oct 2016 19:35:07 -0500 Subject: [PATCH] SCI32: Fix mouse position clamping --- engines/sci/event.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/engines/sci/event.cpp b/engines/sci/event.cpp index 44ac7ef4cf8c..e3652969149f 100644 --- a/engines/sci/event.cpp +++ b/engines/sci/event.cpp @@ -173,20 +173,18 @@ SciEvent EventManager::getScummVMEvent() { if (getSciVersion() >= SCI_VERSION_2) { const Buffer &screen = g_sci->_gfxFrameout->getCurrentBuffer(); + // This will clamp `mousePos` according to the restricted zone, + // so any cursor or screen item associated with the mouse position + // does not bounce when it hits the edge (or ignore the edge) + g_sci->_gfxCursor32->deviceMoved(mousePos); + Common::Point mousePosSci = mousePos; mulru(mousePosSci, Ratio(screen.scriptWidth, screen.screenWidth), Ratio(screen.scriptHeight, screen.screenHeight)); noEvent.mousePosSci = input.mousePosSci = mousePosSci; - if (ev.type == Common::EVENT_MOUSEMOVE) { - // This will clamp `mousePos` according to the restricted zone, - // so any cursor or screen item associated with the mouse position - // does not bounce when it hits the edge (or ignore the edge) - g_sci->_gfxCursor32->deviceMoved(mousePos); - if (_hotRectanglesActive) { - checkHotRectangles(mousePosSci); - } + if (_hotRectanglesActive) { + checkHotRectangles(mousePosSci); } - } else { #endif g_sci->_gfxScreen->adjustBackUpscaledCoordinates(mousePos.y, mousePos.x);