mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-03 17:33:05 +00:00
SCI32: Fix mouse position clamping
This commit is contained in:
parent
c3adfc065e
commit
6303468555
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user