IPHONE: Fixed mouse position when the overlay is visible

This commit is contained in:
Oystein Eftevaag 2011-05-15 21:43:27 -04:00
parent 0b8d2c4d60
commit 5a3aa7a994

View File

@ -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;
}