Permalink
Browse files

Trying again

  • Loading branch information...
1 parent 14bc6c9 commit ca1e66039e06a557a3ae27378bb46e7b7ed5c031 @Nezz Nezz committed Feb 12, 2013
@@ -269,7 +269,7 @@ internal DisplayOrientation GetEffectiveSupportedOrientations()
}
else
{
- return DisplayOrientation.Portrait | DisplayOrientation.PortraitUpsideDown;
+ return DisplayOrientation.Portrait | DisplayOrientation.PortraitDown;
}
}
else
@@ -294,8 +294,8 @@ internal void SetOrientation(DisplayOrientation newOrientation, bool applyGraphi
newOrientation = DisplayOrientation.LandscapeRight;
else if ((supported & DisplayOrientation.Portrait) != 0)
newOrientation = DisplayOrientation.Portrait;
- else if ((supported & DisplayOrientation.PortraitUpsideDown) != 0)
- newOrientation = DisplayOrientation.PortraitUpsideDown;
+ else if ((supported & DisplayOrientation.PortraitDown) != 0)
+ newOrientation = DisplayOrientation.PortraitDown;
}
DisplayOrientation oldOrientation = CurrentOrientation;
@@ -386,7 +386,7 @@ private set
{
DisplayOrientation supported = GetEffectiveSupportedOrientations();
ScreenOrientation requestedOrientation = ScreenOrientation.Unspecified;
- bool wasPortrait = _currentOrientation == DisplayOrientation.Portrait || _currentOrientation == DisplayOrientation.PortraitUpsideDown;
+ bool wasPortrait = _currentOrientation == DisplayOrientation.Portrait || _currentOrientation == DisplayOrientation.PortraitDown;
bool requestPortrait = false;
bool didOrientationChange = false;
@@ -413,7 +413,7 @@ private set
requestedOrientation = (ScreenOrientation)ScreenOrientationAll.Portrait;
requestPortrait = true;
break;
- case DisplayOrientation.PortraitUpsideDown:
+ case DisplayOrientation.PortraitDown:
requestedOrientation = (ScreenOrientation)ScreenOrientationAll.ReversePortrait;
requestPortrait = true;
break;
@@ -432,8 +432,8 @@ private set
requestPortrait = false;
}
// Check if the requested orientation is either of the portrain orientations and any portrait orientation is supported.
- else if ((value == DisplayOrientation.Portrait || value == DisplayOrientation.PortraitUpsideDown) &&
- ((supported & (DisplayOrientation.Portrait | DisplayOrientation.PortraitUpsideDown)) != 0))
+ else if ((value == DisplayOrientation.Portrait || value == DisplayOrientation.PortraitDown) &&
+ ((supported & (DisplayOrientation.Portrait | DisplayOrientation.PortraitDown)) != 0))
{
didOrientationChange = true;
_currentOrientation = DisplayOrientation.Portrait;
@@ -55,7 +55,7 @@ public override void OnOrientationChanged(int orientation)
break;
case 0: disporientation = DisplayOrientation.Portrait;
break;
- case 180: disporientation = DisplayOrientation.PortraitUpsideDown;
+ case 180: disporientation = DisplayOrientation.PortraitDown;
break;
default:
disporientation = DisplayOrientation.LandscapeLeft;
@@ -284,7 +284,7 @@ private void FillTouchCollection(NSSet touches)
break;
}
- case DisplayOrientation.PortraitUpsideDown :
+ case DisplayOrientation.PortraitDown :
{
translatedPosition = new Vector2( ClientBounds.Width - position.X, ClientBounds.Height - position.Y );
break;
@@ -316,7 +316,7 @@ private void FillTouchCollection(NSSet touches)
break;
}
- case DisplayOrientation.PortraitUpsideDown :
+ case DisplayOrientation.PortraitDown :
{
translatedPosition = new Vector2( ClientBounds.Width - position.X, ClientBounds.Height - position.Y );
break;
@@ -77,15 +77,15 @@ public static DisplayOrientation UIDeviceOrientationToDisplayOrientation(UIDevic
{
switch (orientation)
{
- case UIDeviceOrientation.FaceDown: return DisplayOrientation.FaceDown;
- case UIDeviceOrientation.FaceUp: return DisplayOrientation.FaceUp;
+ case UIDeviceOrientation.FaceDown: return DisplayOrientation.Unknown;
+ case UIDeviceOrientation.FaceUp: return DisplayOrientation.Unknown;
default:
// NOTE: in XNA, Orientation Left is a 90 degree rotation counterclockwise, while on iOS
// it is a 90 degree rotation CLOCKWISE. They are BACKWARDS!
case UIDeviceOrientation.LandscapeLeft: return DisplayOrientation.LandscapeRight;
case UIDeviceOrientation.LandscapeRight: return DisplayOrientation.LandscapeLeft;
case UIDeviceOrientation.Portrait: return DisplayOrientation.Portrait;
- case UIDeviceOrientation.PortraitUpsideDown: return DisplayOrientation.PortraitUpsideDown;
+ case UIDeviceOrientation.PortraitUpsideDown: return DisplayOrientation.PortraitDown;
}
}
@@ -99,26 +99,26 @@ public static DisplayOrientation ToDisplayOrientation(UIInterfaceOrientation ori
case UIInterfaceOrientation.LandscapeLeft: return DisplayOrientation.LandscapeRight;
case UIInterfaceOrientation.LandscapeRight: return DisplayOrientation.LandscapeLeft;
case UIInterfaceOrientation.Portrait: return DisplayOrientation.Portrait;
- case UIInterfaceOrientation.PortraitUpsideDown: return DisplayOrientation.PortraitUpsideDown;
+ case UIInterfaceOrientation.PortraitUpsideDown: return DisplayOrientation.PortraitDown;
}
}
public static UIInterfaceOrientationMask ToUIInterfaceOrientationMask (DisplayOrientation orientation)
{
switch (Normalize(orientation))
{
- case((DisplayOrientation)1):
- case((DisplayOrientation)6):
+ case((DisplayOrientation)0):
+ case((DisplayOrientation)3):
return UIInterfaceOrientationMask.Landscape;
- case((DisplayOrientation)2):
+ case((DisplayOrientation)1):
return UIInterfaceOrientationMask.LandscapeLeft;
- case((DisplayOrientation)4):
+ case((DisplayOrientation)2):
return UIInterfaceOrientationMask.LandscapeRight;
- case((DisplayOrientation)16):
+ case((DisplayOrientation)4):
return UIInterfaceOrientationMask.Portrait;
- case((DisplayOrientation)32):
+ case((DisplayOrientation)8):
return UIInterfaceOrientationMask.PortraitUpsideDown;
- case((DisplayOrientation)14):
+ case((DisplayOrientation)7):
return UIInterfaceOrientationMask.AllButUpsideDown;
default:
return UIInterfaceOrientationMask.All;

0 comments on commit ca1e660

Please sign in to comment.