diff options
author | Oystein Eftevaag | 2011-05-15 21:43:27 -0400 |
---|---|---|
committer | Oystein Eftevaag | 2011-05-15 21:47:11 -0400 |
commit | 5a3aa7a994b772c8f084350f6f80d38a3ae4ddaa (patch) | |
tree | f187baa7fb2eb408618ba2d795d5ca2e39873d89 /backends/platform | |
parent | 0b8d2c4d60b347543fc3a151489da2d55ca59a7f (diff) | |
download | scummvm-rg350-5a3aa7a994b772c8f084350f6f80d38a3ae4ddaa.tar.gz scummvm-rg350-5a3aa7a994b772c8f084350f6f80d38a3ae4ddaa.tar.bz2 scummvm-rg350-5a3aa7a994b772c8f084350f6f80d38a3ae4ddaa.zip |
IPHONE: Fixed mouse position when the overlay is visible
Diffstat (limited to 'backends/platform')
-rw-r--r-- | backends/platform/iphone/iphone_video.m | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/backends/platform/iphone/iphone_video.m b/backends/platform/iphone/iphone_video.m index 09832c783e..006603df64 100644 --- a/backends/platform/iphone/iphone_video.m +++ b/backends/platform/iphone/iphone_video.m @@ -175,13 +175,18 @@ const char* iPhone_getDocumentsDir() { } bool getLocalMouseCoords(CGPoint *point) { - if (point->x < _screenRect.origin.x || point->x >= _screenRect.origin.x + _screenRect.size.width || - point->y < _screenRect.origin.y || point->y >= _screenRect.origin.y + _screenRect.size.height) { - return false; - } + if (_overlayIsEnabled) { + point->x = point->x / _overlayHeight; + point->y = point->y / _overlayWidth; + } else { + if (point->x < _screenRect.origin.x || point->x >= _screenRect.origin.x + _screenRect.size.width || + point->y < _screenRect.origin.y || point->y >= _screenRect.origin.y + _screenRect.size.height) { + return false; + } - point->x = (point->x - _screenRect.origin.x) / _screenRect.size.width; - point->y = (point->y - _screenRect.origin.y) / _screenRect.size.height; + point->x = (point->x - _screenRect.origin.x) / _screenRect.size.width; + point->y = (point->y - _screenRect.origin.y) / _screenRect.size.height; + } return true; } |