mirror of
https://github.com/spiffcode/hostile-takeover.git
synced 2026-06-04 07:54:58 -06:00
handle display and input coordinate changes introduced by iOS 8
This commit is contained in:
parent
c3e42fe2d6
commit
16edf8fb58
@ -181,9 +181,15 @@ bool ProcessMessage(base::Message *pmsg, Event *pevt)
|
|||||||
gpdisp->GetMode(&mode);
|
gpdisp->GetMode(&mode);
|
||||||
switch (mode.nDegreeOrientation) {
|
switch (mode.nDegreeOrientation) {
|
||||||
case 0:
|
case 0:
|
||||||
|
#if 0 // iOS <= 7
|
||||||
// Screen rotated 90 degrees but coordinates unrotated
|
// Screen rotated 90 degrees but coordinates unrotated
|
||||||
pevt->x = pmsg->y;
|
pevt->x = pmsg->y;
|
||||||
pevt->y = (cy - 1) - pmsg->x;
|
pevt->y = (cy - 1) - pmsg->x;
|
||||||
|
#else
|
||||||
|
// As of iOS 8 screen coordinates are interface oriented not device oriented.
|
||||||
|
pevt->x = pmsg->x;
|
||||||
|
pevt->y = pmsg->y;
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 90:
|
case 90:
|
||||||
|
|||||||
@ -23,7 +23,12 @@
|
|||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0 // iOS <= 7
|
||||||
rect_ = CGRectMake(0, 0, rect.size.height, rect.size.width);
|
rect_ = CGRectMake(0, 0, rect.size.height, rect.size.width);
|
||||||
|
#else
|
||||||
|
// As of iOS 8 screen coordinates are interface oriented not device oriented.
|
||||||
|
rect_ = CGRectMake(0, 0, rect.size.width, rect.size.height);
|
||||||
|
#endif
|
||||||
|
|
||||||
[self setMultipleTouchEnabled: YES];
|
[self setMultipleTouchEnabled: YES];
|
||||||
atouch_[0] = NULL;
|
atouch_[0] = NULL;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user