handle display and input coordinate changes introduced by iOS 8

This commit is contained in:
Scott Ludwig 2016-01-01 12:03:03 -08:00
parent c3e42fe2d6
commit 16edf8fb58
2 changed files with 12 additions and 1 deletions

View File

@ -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:

View File

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