diff options
author | Oystein Eftevaag | 2011-05-15 21:43:27 -0400 |
---|---|---|
committer | Oystein Eftevaag | 2011-05-15 21:43:53 -0400 |
commit | a1f02c3f32fb0d6189bdc83aedfe597281afe9cd (patch) | |
tree | 3a2549c8d0215a4ece5f0d3b3ea07f3b9d653a93 /backends | |
parent | 136d687dd30b4721127ae359837c8470c95306ec (diff) | |
download | scummvm-rg350-a1f02c3f32fb0d6189bdc83aedfe597281afe9cd.tar.gz scummvm-rg350-a1f02c3f32fb0d6189bdc83aedfe597281afe9cd.tar.bz2 scummvm-rg350-a1f02c3f32fb0d6189bdc83aedfe597281afe9cd.zip |
IPHONE: Fixed mouse position when the overlay is visible
Diffstat (limited to 'backends')
-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 821d3de634..4fdb820f70 100644 --- a/backends/platform/iphone/iphone_video.m +++ b/backends/platform/iphone/iphone_video.m @@ -178,13 +178,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; } |