|
@@ -247,9 +247,13 @@ CGFloat const PanoramaGuideViewWOrH = 120;
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
CGFloat imageWH = 0;
|
|
CGFloat imageWH = 0;
|
|
if (image) {
|
|
if (image) {
|
|
- imageWH = (PanoramaGuideViewWOrH * image.size.width)/image.size.height;
|
|
|
|
|
|
+ if (dir == PanoramaOrientationViewDown || dir == PanoramaOrientationViewUp) {
|
|
|
|
+ imageWH = (PanoramaGuideViewWOrH * image.size.height)/image.size.width;
|
|
|
|
+ } else {
|
|
|
|
+ imageWH = (PanoramaGuideViewWOrH * image.size.width)/image.size.height;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
// UIImage *resultImage = [self showDir:dir image:image];
|
|
// UIImage *resultImage = [self showDir:dir image:image];
|
|
self.showImageView.image = image;
|
|
self.showImageView.image = image;
|
|
[UIView animateWithDuration:.15 animations:^{
|
|
[UIView animateWithDuration:.15 animations:^{
|
|
@@ -339,100 +343,103 @@ CGFloat const PanoramaGuideViewWOrH = 120;
|
|
if (dir == PanoramaOrientationViewDown || dir == PanoramaOrientationViewUp) {
|
|
if (dir == PanoramaOrientationViewDown || dir == PanoramaOrientationViewUp) {
|
|
if (arrowDir == PanoramaArrowDirCenter) {
|
|
if (arrowDir == PanoramaArrowDirCenter) {
|
|
self.offSetLeft = @((120-38)/2);
|
|
self.offSetLeft = @((120-38)/2);
|
|
- [self.whiteArrow mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
- make.bottom.offset(-(PanoramaGuideViewWOrH * imageWidth)/imageHight);
|
|
|
|
-// make.centerX.mas_equalTo(self);
|
|
|
|
- make.left.mas_offset(self.offSetLeft.doubleValue);
|
|
|
|
- }];
|
|
|
|
|
|
+// [self.whiteArrow mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
+// make.bottom.offset(-(PanoramaGuideViewWOrH * imageWidth)/imageHight);
|
|
|
|
+//// make.centerX.mas_equalTo(self);
|
|
|
|
+// make.left.mas_offset(self.offSetLeft.doubleValue);
|
|
|
|
+// }];
|
|
} else if (arrowDir == PanoramaArrowDirLeft) {
|
|
} else if (arrowDir == PanoramaArrowDirLeft) {
|
|
self.offSetLeft = @(0);
|
|
self.offSetLeft = @(0);
|
|
- [self.whiteArrow mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
- make.bottom.offset(-(PanoramaGuideViewWOrH * imageWidth)/imageHight);
|
|
|
|
-// make.left.mas_equalTo(self).mas_offset(10);
|
|
|
|
- make.left.mas_offset(self.offSetLeft.doubleValue);
|
|
|
|
-
|
|
|
|
- }];
|
|
|
|
|
|
+// [self.whiteArrow mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
+// make.bottom.offset(-(PanoramaGuideViewWOrH * imageWidth)/imageHight);
|
|
|
|
+//// make.left.mas_equalTo(self).mas_offset(10);
|
|
|
|
+// make.left.mas_offset(self.offSetLeft.doubleValue);
|
|
|
|
+//
|
|
|
|
+// }];
|
|
} else if (arrowDir == PanoramaArrowDirRight) {
|
|
} else if (arrowDir == PanoramaArrowDirRight) {
|
|
self.offSetLeft = @(120-38);
|
|
self.offSetLeft = @(120-38);
|
|
|
|
|
|
- [self.whiteArrow mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
- make.bottom.offset(-(PanoramaGuideViewWOrH * imageWidth)/imageHight);
|
|
|
|
-// make.right.mas_equalTo(self).mas_offset(-10);
|
|
|
|
- make.left.mas_offset(self.offSetLeft.doubleValue);
|
|
|
|
-
|
|
|
|
- }];
|
|
|
|
- }
|
|
|
|
- } else if (dir == PanoramaOrientationViewUp) {
|
|
|
|
- if (arrowDir == PanoramaArrowDirCenter) {
|
|
|
|
- self.offSetTop = @((120-38)/2);
|
|
|
|
-
|
|
|
|
- [self.whiteArrow mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
- make.top.offset((PanoramaGuideViewWOrH * imageWidth)/imageHight);
|
|
|
|
-// make.centerX.mas_equalTo(self);
|
|
|
|
- make.top.mas_offset(self.offSetTop.doubleValue);
|
|
|
|
- }];
|
|
|
|
- } else if (arrowDir == PanoramaArrowDirLeft) {
|
|
|
|
- self.offSetTop = @((120-38)/2);
|
|
|
|
-
|
|
|
|
- [self.whiteArrow mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
- make.top.offset((PanoramaGuideViewWOrH * imageWidth)/imageHight);
|
|
|
|
- make.left.mas_equalTo(self).mas_offset(10);
|
|
|
|
- }];
|
|
|
|
- } else if (arrowDir == PanoramaArrowDirRight) {
|
|
|
|
- [self.whiteArrow mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
- make.top.offset((PanoramaGuideViewWOrH * imageWidth)/imageHight);
|
|
|
|
- make.right.mas_equalTo(self).mas_offset(-10);
|
|
|
|
- }];
|
|
|
|
|
|
+// [self.whiteArrow mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
+// make.bottom.offset(-(PanoramaGuideViewWOrH * imageWidth)/imageHight);
|
|
|
|
+//// make.right.mas_equalTo(self).mas_offset(-10);
|
|
|
|
+// make.left.mas_offset(self.offSetLeft.doubleValue);
|
|
|
|
+//
|
|
|
|
+// }];
|
|
}
|
|
}
|
|
-
|
|
|
|
- } else if (dir == PanoramaOrientationViewLeft || dir == PanoramaOrientationViewRight) {
|
|
|
|
|
|
+ }
|
|
|
|
+// else if (dir == PanoramaOrientationViewUp) {
|
|
|
|
+// if (arrowDir == PanoramaArrowDirCenter) {
|
|
|
|
+// self.offSetTop = @((120-38)/2);
|
|
|
|
+//
|
|
|
|
+//// [self.whiteArrow mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
+//// make.top.offset((PanoramaGuideViewWOrH * imageWidth)/imageHight);
|
|
|
|
+////// make.centerX.mas_equalTo(self);
|
|
|
|
+//// make.top.mas_offset(self.offSetTop.doubleValue);
|
|
|
|
+//// }];
|
|
|
|
+// } else if (arrowDir == PanoramaArrowDirLeft) {
|
|
|
|
+// self.offSetTop = @((120-38)/2);
|
|
|
|
+//
|
|
|
|
+// [self.whiteArrow mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
+// make.top.offset((PanoramaGuideViewWOrH * imageWidth)/imageHight);
|
|
|
|
+// make.left.mas_equalTo(self).mas_offset(10);
|
|
|
|
+// }];
|
|
|
|
+// } else if (arrowDir == PanoramaArrowDirRight) {
|
|
|
|
+// [self.whiteArrow mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
+// make.top.offset((PanoramaGuideViewWOrH * imageWidth)/imageHight);
|
|
|
|
+// make.right.mas_equalTo(self).mas_offset(-10);
|
|
|
|
+// }];
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// }
|
|
|
|
+ else if (dir == PanoramaOrientationViewLeft || dir == PanoramaOrientationViewRight) {
|
|
if (arrowDir == PanoramaArrowDirCenter) {
|
|
if (arrowDir == PanoramaArrowDirCenter) {
|
|
self.offSetTop = @((120-38)/2);
|
|
self.offSetTop = @((120-38)/2);
|
|
-
|
|
|
|
- [self.whiteArrow mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
- make.left.offset((PanoramaGuideViewWOrH * imageWidth)/imageHight);
|
|
|
|
-// make.centerY.mas_equalTo(self);
|
|
|
|
- make.top.mas_offset(self.offSetTop.doubleValue);
|
|
|
|
-
|
|
|
|
- }];
|
|
|
|
|
|
+//
|
|
|
|
+// [self.whiteArrow mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
+// make.left.offset((PanoramaGuideViewWOrH * imageWidth)/imageHight);
|
|
|
|
+//// make.centerY.mas_equalTo(self);
|
|
|
|
+// make.top.mas_offset(self.offSetTop.doubleValue);
|
|
|
|
+//
|
|
|
|
+// }];
|
|
} else if (arrowDir == PanoramaArrowDirUp) {
|
|
} else if (arrowDir == PanoramaArrowDirUp) {
|
|
self.offSetTop = @(0);
|
|
self.offSetTop = @(0);
|
|
|
|
|
|
- [self.whiteArrow mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
- make.left.offset((PanoramaGuideViewWOrH * imageWidth)/imageHight);
|
|
|
|
-// make.top.mas_equalTo(self).mas_offset(10);
|
|
|
|
- make.top.mas_offset(self.offSetTop.doubleValue);
|
|
|
|
-
|
|
|
|
- }];
|
|
|
|
|
|
+// [self.whiteArrow mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
+// make.left.offset((PanoramaGuideViewWOrH * imageWidth)/imageHight);
|
|
|
|
+//// make.top.mas_equalTo(self).mas_offset(10);
|
|
|
|
+// make.top.mas_offset(self.offSetTop.doubleValue);
|
|
|
|
+//
|
|
|
|
+// }];
|
|
} else if (arrowDir == PanoramaArrowDirDown) {
|
|
} else if (arrowDir == PanoramaArrowDirDown) {
|
|
self.offSetTop = @(120-38);
|
|
self.offSetTop = @(120-38);
|
|
|
|
|
|
- [self.whiteArrow mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
- make.left.offset((PanoramaGuideViewWOrH * imageWidth)/imageHight);
|
|
|
|
-// make.bottom.mas_equalTo(self).mas_offset(-10);
|
|
|
|
- make.top.mas_offset(self.offSetTop.doubleValue);
|
|
|
|
-
|
|
|
|
- }];
|
|
|
|
|
|
+// [self.whiteArrow mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
+// make.left.offset((PanoramaGuideViewWOrH * imageWidth)/imageHight);
|
|
|
|
+//// make.bottom.mas_equalTo(self).mas_offset(-10);
|
|
|
|
+// make.top.mas_offset(self.offSetTop.doubleValue);
|
|
|
|
+//
|
|
|
|
+// }];
|
|
}
|
|
}
|
|
|
|
|
|
- } else if (dir == PanoramaOrientationViewRight) {
|
|
|
|
- if (arrowDir == PanoramaArrowDirCenter) {
|
|
|
|
- [self.whiteArrow mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
- make.left.offset((PanoramaGuideViewWOrH * imageWidth)/imageHight);
|
|
|
|
- make.centerY.mas_equalTo(self);
|
|
|
|
- }];
|
|
|
|
- } else if (arrowDir == PanoramaArrowDirUp) {
|
|
|
|
- [self.whiteArrow mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
- make.left.offset((PanoramaGuideViewWOrH * imageWidth)/imageHight);
|
|
|
|
- make.top.mas_equalTo(self).mas_offset(10);
|
|
|
|
- }];
|
|
|
|
- } else if (arrowDir == PanoramaArrowDirDown) {
|
|
|
|
- [self.whiteArrow mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
- make.right.offset(-(PanoramaGuideViewWOrH * imageWidth)/imageHight);
|
|
|
|
- make.bottom.mas_equalTo(self).mas_offset(-10);
|
|
|
|
- }];
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
|
|
+// else if (dir == PanoramaOrientationViewRight) {
|
|
|
|
+// if (arrowDir == PanoramaArrowDirCenter) {
|
|
|
|
+// [self.whiteArrow mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
+// make.left.offset((PanoramaGuideViewWOrH * imageWidth)/imageHight);
|
|
|
|
+// make.centerY.mas_equalTo(self);
|
|
|
|
+// }];
|
|
|
|
+// } else if (arrowDir == PanoramaArrowDirUp) {
|
|
|
|
+// [self.whiteArrow mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
+// make.left.offset((PanoramaGuideViewWOrH * imageWidth)/imageHight);
|
|
|
|
+// make.top.mas_equalTo(self).mas_offset(10);
|
|
|
|
+// }];
|
|
|
|
+// } else if (arrowDir == PanoramaArrowDirDown) {
|
|
|
|
+// [self.whiteArrow mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
+// make.right.offset(-(PanoramaGuideViewWOrH * imageWidth)/imageHight);
|
|
|
|
+// make.bottom.mas_equalTo(self).mas_offset(-10);
|
|
|
|
+// }];
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
|
|
});
|
|
});
|
|
}
|
|
}
|