Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Classes/HUD/M13ProgressHUD.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ typedef enum {
*/
@property (nonatomic, assign) BOOL shouldAutorotate;
/**The orientation of the HUD.*/
@property (nonatomic, assign) UIInterfaceOrientation orientation;
@property (nonatomic, assign) UIInterfaceOrientation progressOrientation;

/**@name Actions*/
/**Set the progress of the `M13ProgressView`.
Expand Down
18 changes: 9 additions & 9 deletions Classes/HUD/M13ProgressHUD.m
Original file line number Diff line number Diff line change
Expand Up @@ -407,20 +407,20 @@ - (void)unregisterFromNotificationCenter {
}

- (void)deviceOrientationDidChange:(NSNotification *)notification {
UIDeviceOrientation deviceOrientation = [notification.object orientation];
UIDeviceOrientation deviceOrientation = [notification.object progressOrientation];

if (_shouldAutorotate && UIDeviceOrientationIsValidInterfaceOrientation(deviceOrientation)) {
if (UIDeviceOrientationIsPortrait(deviceOrientation)) {
if (deviceOrientation == UIDeviceOrientationPortraitUpsideDown) {
_orientation = UIInterfaceOrientationPortraitUpsideDown;
_progressOrientation = UIInterfaceOrientationPortraitUpsideDown;
} else {
_orientation = UIInterfaceOrientationPortrait;
_progressOrientation = UIInterfaceOrientationPortrait;
}
} else {
if (deviceOrientation == UIDeviceOrientationLandscapeLeft) {
_orientation = UIInterfaceOrientationLandscapeLeft;
_progressOrientation = UIInterfaceOrientationLandscapeLeft;
} else {
_orientation = UIInterfaceOrientationLandscapeRight;
_progressOrientation = UIInterfaceOrientationLandscapeRight;
}
}
[self layoutHUD];
Expand Down Expand Up @@ -567,7 +567,7 @@ - (void)layoutHUD
}

//Swap height and with on rotation
if (_orientation == UIInterfaceOrientationLandscapeLeft || _orientation == UIInterfaceOrientationLandscapeRight) {
if (_progressOrientation == UIInterfaceOrientationLandscapeLeft || _progressOrientation == UIInterfaceOrientationLandscapeRight) {
//Flip the width and height.
CGFloat temp = backgroundRect.size.width;
backgroundRect.size.width = backgroundRect.size.height;
Expand Down Expand Up @@ -803,11 +803,11 @@ - (UIImage *)snapshotForBlurredBackgroundInView:(UIView *)view

- (CGFloat)angleForDeviceOrientation
{
if (_orientation == UIInterfaceOrientationLandscapeLeft) {
if (_progressOrientation == UIInterfaceOrientationLandscapeLeft) {
return M_PI_2;
} else if (_orientation == UIInterfaceOrientationLandscapeRight) {
} else if (_progressOrientation == UIInterfaceOrientationLandscapeRight) {
return -M_PI_2;
} else if (_orientation == UIInterfaceOrientationPortraitUpsideDown) {
} else if (_progressOrientation == UIInterfaceOrientationPortraitUpsideDown) {
return M_PI;
}
return 0;
Expand Down