mirror of
https://github.com/spiffcode/hostile-takeover.git
synced 2026-04-07 19:11:26 -06:00
handle display and input coordinate changes introduced by iOS 8
This commit is contained in:
parent
c3e42fe2d6
commit
16edf8fb58
@ -129,7 +129,7 @@ bool ProcessMessage(base::Message *pmsg, Event *pevt)
|
||||
case kidmMouseMove2:
|
||||
pevt->eType = penMoveEvent2;
|
||||
pevt->ff = kfEvtFinger;
|
||||
break;
|
||||
break;
|
||||
|
||||
case kidmAppTerminate:
|
||||
pevt->eType = appStopEvent;
|
||||
@ -181,9 +181,15 @@ bool ProcessMessage(base::Message *pmsg, Event *pevt)
|
||||
gpdisp->GetMode(&mode);
|
||||
switch (mode.nDegreeOrientation) {
|
||||
case 0:
|
||||
#if 0 // iOS <= 7
|
||||
// Screen rotated 90 degrees but coordinates unrotated
|
||||
pevt->x = pmsg->y;
|
||||
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;
|
||||
|
||||
case 90:
|
||||
|
||||
@ -23,7 +23,12 @@
|
||||
return nil;
|
||||
}
|
||||
|
||||
#if 0 // iOS <= 7
|
||||
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];
|
||||
atouch_[0] = NULL;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user