lxy 1 год назад
Родитель
Сommit
8aac877cd6

+ 150 - 28
LenzCameraNativeModuleForRN/Classes/inner/PCSBaseViewController/PCSBaseViewController.m

@@ -909,34 +909,130 @@
             
             
             PanoramaOrientationViewDirectionEnum dir = (PanoramaOrientationViewDirectionEnum)wearSelf.panoramOrientationGuideView.selectedItemIndex;
-            if (dir == PanoramaOrientationViewLeft || dir == PanoramaOrientationViewRight) {
-                if (fabs(x) < 3) {
-//                    NSLog(@"~~~~~~~~~~~~~~~  中");
-                    [wearSelf.panoramaGuideView updateArrowWith:PanoramaArrowDirCenter dir:dir];
-                } else {
-                    if (x > 0) {
-//                        NSLog(@"~~~~~~~~~~~~~~~  下");
-                        [wearSelf.panoramaGuideView updateArrowWith:PanoramaArrowDirDown dir:dir];
+            if (self.currentTgDirection == TgDirectionPortrait) {
+                if (dir == PanoramaOrientationViewLeft || dir == PanoramaOrientationViewRight) {
+                    if (fabs(x) < 3) {
+//                        NSLog(@"~~~~~~~~~~~~~~~  中");
+                        [wearSelf.panoramaGuideView updateArrowWith:PanoramaArrowDirCenter dir:dir];
                     } else {
-//                        NSLog(@"~~~~~~~~~~~~~~~  上");
-                        [wearSelf.panoramaGuideView updateArrowWith:PanoramaArrowDirUp dir:dir];
+                        if (x > 0) {
+//                            NSLog(@"~~~~~~~~~~~~~~~  下");
+                            [wearSelf.panoramaGuideView updateArrowWith:PanoramaArrowDirDown dir:dir];
+                        } else {
+//                            NSLog(@"~~~~~~~~~~~~~~~  上");
+                            [wearSelf.panoramaGuideView updateArrowWith:PanoramaArrowDirUp dir:dir];
+                        }
+                    }
+                } else if (dir == PanoramaOrientationViewUp || dir == PanoramaOrientationViewDown) {
+                    
+                    if (fabs(y) < 3) {
+//                        NSLog(@"~~~~~~~~~~~~~~~  中");
+                        [wearSelf.panoramaGuideView updateArrowWith:PanoramaArrowDirCenter dir:dir];
+                    } else {
+                        if (y > 0) {
+//                            NSLog(@"~~~~~~~~~~~~~~~  左");
+                            [wearSelf.panoramaGuideView updateArrowWith:PanoramaArrowDirLeft dir:dir];
+                        } else {
+//                            NSLog(@"~~~~~~~~~~~~~~~  右");
+                            [wearSelf.panoramaGuideView updateArrowWith:PanoramaArrowDirRight dir:dir];
+                        }
                     }
                 }
-            } else if (dir == PanoramaOrientationViewUp || dir == PanoramaOrientationViewDown) {
-                
-                if (fabs(y) < 3) {
-//                    NSLog(@"~~~~~~~~~~~~~~~  中");
-                    [wearSelf.panoramaGuideView updateArrowWith:PanoramaArrowDirCenter dir:dir];
-                } else {
-                    if (y > 0) {
-//                        NSLog(@"~~~~~~~~~~~~~~~  左");
-                        [wearSelf.panoramaGuideView updateArrowWith:PanoramaArrowDirLeft dir:dir];
+            } else if (self.currentTgDirection == TgDirectionLeft) {
+                if (dir == PanoramaOrientationViewLeft || dir == PanoramaOrientationViewRight) {
+                    
+                    if (fabs(y) < 3) {
+//                        NSLog(@"~~~~~~~/~~~~~~~~  中");
+                        [wearSelf.panoramaGuideView updateArrowWith:PanoramaArrowDirCenter dir:dir];
+                    } else {
+                        if (y > 0) {
+//                            NSLog(@"~~~~~~~~~~~~~~~  上");
+                            [wearSelf.panoramaGuideView updateArrowWith:PanoramaArrowDirRight dir:dir];
+                        } else {
+                            [wearSelf.panoramaGuideView updateArrowWith:PanoramaArrowDirLeft dir:dir];
+
+//                            NSLog(@"~~~~~~~~~~~~~~~  下");
+                        }
+                    }
+                    
+                } else if (dir == PanoramaOrientationViewUp || dir == PanoramaOrientationViewDown) {
+                    
+                    if (fabs(x) < 3) {
+//                        NSLog(@"~~~~~~~~~~~~~~~  中");
+                        [wearSelf.panoramaGuideView updateArrowWith:PanoramaArrowDirCenter dir:dir];
+                    } else {
+                        if (x > 0) {
+//                            NSLog(@"~~~~~~~~~~~~~~~  下");
+                            [wearSelf.panoramaGuideView updateArrowWith:PanoramaArrowDirDown dir:dir];
+                        } else {
+//                            NSLog(@"~~~~~~~~~~~~~~~  上");
+                            [wearSelf.panoramaGuideView updateArrowWith:PanoramaArrowDirUp dir:dir];
+                        }
+                    }
+                }
+            } else if (self.currentTgDirection == TgDirectionRight) {
+                if (dir == PanoramaOrientationViewLeft || dir == PanoramaOrientationViewRight) {
+                    
+                    if (fabs(y) < 3) {
+//                        NSLog(@"~~~~~~~~~~~~~~~  中");
+                        [wearSelf.panoramaGuideView updateArrowWith:PanoramaArrowDirCenter dir:dir];
+                    } else {
+                        if (y > 0) {
+//                            NSLog(@"~~~~~~~~~~~~~~~  上");
+                            [wearSelf.panoramaGuideView updateArrowWith:PanoramaArrowDirRight dir:dir];
+                        } else {
+                            [wearSelf.panoramaGuideView updateArrowWith:PanoramaArrowDirLeft dir:dir];
+
+//                            NSLog(@"~~~~~~~~~~~~~~~  下");
+                        }
+                    }
+                    
+                } else if (dir == PanoramaOrientationViewUp || dir == PanoramaOrientationViewDown) {
+                    
+                    if (fabs(x) < 3) {
+//                        NSLog(@"~~~~~~~~~~~~~~~  中");
+                        [wearSelf.panoramaGuideView updateArrowWith:PanoramaArrowDirCenter dir:dir];
                     } else {
-//                        NSLog(@"~~~~~~~~~~~~~~~  右");
-                        [wearSelf.panoramaGuideView updateArrowWith:PanoramaArrowDirRight dir:dir];
+                        if (x > 0) {
+//                            NSLog(@"~~~~~~~~~~~~~~~  下");
+                            [wearSelf.panoramaGuideView updateArrowWith:PanoramaArrowDirDown dir:dir];
+                        } else {
+//                            NSLog(@"~~~~~~~~~~~~~~~  上");
+                            [wearSelf.panoramaGuideView updateArrowWith:PanoramaArrowDirUp dir:dir];
+                        }
+                    }
+                }
+            } else if (self.currentTgDirection == TgDirectionDown) {
+                if (dir == PanoramaOrientationViewLeft || dir == PanoramaOrientationViewRight) {
+                    if (fabs(x) < 3) {
+//                        NSLog(@"~~~~~~~~~~~~~~~  中");
+                        [wearSelf.panoramaGuideView updateArrowWith:PanoramaArrowDirCenter dir:dir];
+                    } else {
+                        if (x > 0) {
+//                            NSLog(@"~~~~~~~~~~~~~~~  下");
+                            [wearSelf.panoramaGuideView updateArrowWith:PanoramaArrowDirDown dir:dir];
+                        } else {
+//                            NSLog(@"~~~~~~~~~~~~~~~  上");
+                            [wearSelf.panoramaGuideView updateArrowWith:PanoramaArrowDirUp dir:dir];
+                        }
+                    }
+                } else if (dir == PanoramaOrientationViewUp || dir == PanoramaOrientationViewDown) {
+                    
+                    if (fabs(y) < 3) {
+//                        NSLog(@"~~~~~~~~~~~~~~~  中");
+                        [wearSelf.panoramaGuideView updateArrowWith:PanoramaArrowDirCenter dir:dir];
+                    } else {
+                        if (y > 0) {
+//                            NSLog(@"~~~~~~~~~~~~~~~  左");
+                            [wearSelf.panoramaGuideView updateArrowWith:PanoramaArrowDirLeft dir:dir];
+                        } else {
+//                            NSLog(@"~~~~~~~~~~~~~~~  右");
+                            [wearSelf.panoramaGuideView updateArrowWith:PanoramaArrowDirRight dir:dir];
+                        }
                     }
                 }
             }
+    
             
         }];
     }
@@ -945,8 +1041,9 @@
     [self.motionManager stopDeviceMotionUpdates];
     self.startPitchX = nil;
     self.startRollY = nil;
-    LenVideoStitchDirction dir = (LenVideoStitchDirction)self.panoramOrientationGuideView.selectedItemIndex;
-    [self.panoramaGuideView updateArrowWith:PanoramaArrowDirCenter dir:dir];
+    [self.panoramaGuideView showImageWith:nil];
+//    LenVideoStitchDirction dir = (LenVideoStitchDirction)self.panoramOrientationGuideView.selectedItemIndex;
+//    [self.panoramaGuideView updateArrowWith:PanoramaArrowDirCenter dir:dir];
 }
 #pragma mark - Lazy Load
 - (BaseViewTapGestureDelegate *)tapDelegate{
@@ -2930,9 +3027,25 @@
                 [self updateViewStatusWhenStitchSave:YES];
                 self.isStitchBigImage = YES;
             }
-
+            LenVideoStitchDirction dirction = LenVideoStitchDirctionLeft;
+            if (self.panoramOrientationGuideView.selectedItemIndex == PanoramaOrientationViewUp) {
+                dirction = LenVideoStitchDirctionUp;
+            } else if (self.panoramOrientationGuideView.selectedItemIndex == PanoramaOrientationViewDown) {
+                dirction = LenVideoStitchDirctionDown;
+            } else if (self.panoramOrientationGuideView.selectedItemIndex == PanoramaOrientationViewLeft) {
+                dirction = LenVideoStitchDirctionLeft;
+            } else if (self.panoramOrientationGuideView.selectedItemIndex == PanoramaOrientationViewRight) {
+                dirction = LenVideoStitchDirctionRight;
+            } else {
+                dirction = LenVideoStitchDirctionAny;
+            }
+//            PanoramaOrientationViewAny,
+//            PanoramaOrientationViewUp,
+//            PanoramaOrientationViewRight,
+//            PanoramaOrientationViewLeft,
+//            PanoramaOrientationViewDown,
             [LenStitcher videoStitchWith:sampleBuffer
-                                dirction:(LenVideoStitchDirction)self.panoramOrientationGuideView.selectedItemIndex
+                                dirction:dirction
                                   isStop:self.isVideoStitchStopedWhenRecording
                                 complete:^(LenVideoStitchResult result, LenVideoStitchNeedSave needSave) {
                 self.stitchResult = result;
@@ -3118,11 +3231,20 @@
     if (self.currentTgDirection == TgDirectionPortrait) {
         return image;
     } else if (self.currentTgDirection == TgDirectionLeft) {
-        return [image imageRotateWithIndegree:M_PI/2];
+        UIImage * portraitImage = [[UIImage alloc]initWithCGImage: image.CGImage
+                                                             scale: 1.0
+                                                       orientation: UIImageOrientationLeft];
+        return portraitImage;
     } else if (self.currentTgDirection == TgDirectionRight) {
-        return [image imageRotateWithIndegree:-M_PI/2];
+        UIImage * portraitImage = [[UIImage alloc]initWithCGImage: image.CGImage
+                                                             scale: 1.0
+                                                       orientation: UIImageOrientationRight];
+        return portraitImage;
     } else if (self.currentTgDirection == TgDirectionDown) {
-        return [image imageRotateWithIndegree:M_PI];
+        UIImage * portraitImage = [[UIImage alloc]initWithCGImage: image.CGImage
+                                                             scale: 1.0
+                                                       orientation: UIImageOrientationDown];
+        return portraitImage;
     }
     
     return image;

+ 1 - 0
LenzCameraNativeModuleForRN/Classes/inner/UI/PanoramaGuideView/PanoramaGuideView.h

@@ -28,6 +28,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 @property (nonatomic) TgDirection dir;
 @property (nonatomic) PanoramaOrientationViewDirectionEnum orginDir;
+//@property (nonatomic) UIImage *lastImage;
 
 
 - (void)direction:(PanoramaOrientationViewDirectionEnum)dir;

+ 241 - 38
LenzCameraNativeModuleForRN/Classes/inner/UI/PanoramaGuideView/PanoramaGuideView.m

@@ -473,23 +473,23 @@ CGFloat const PanoramaGuideViewWOrH = 120;
 
 - (void)showImageWith:(UIImage * _Nullable)image {
         
+//    self.lastImage = image;
     dispatch_async(dispatch_get_main_queue(), ^{
-        CGFloat imageWH = 0;
-        if (image) {
-            if (self.currentDirection == PanoramaOrientationViewDown || self.currentDirection == PanoramaOrientationViewUp) {
-                imageWH = (PanoramaGuideViewWOrH * image.size.height)/image.size.width;
-            } else {
-                imageWH = (PanoramaGuideViewWOrH * image.size.width)/image.size.height;
-            }
-        } else {
+       __block CGFloat imageWH = 0;
+        if (!image) {
             self.offSetTop = @((120-38)/2);
             self.offSetLeft = @((120-38)/2);
         }
+        
+        NSLog(@"1111111111111111111&&&&:     %f", self.offSetTop.doubleValue);
 
         self.showImageView.image = image;
         [UIView animateWithDuration:.15 animations:^{
-            switch (self.currentDirection) {
-                case PanoramaOrientationViewDown: {
+            if (self.dir == TgDirectionPortrait) {
+                if (self.orginDir == PanoramaOrientationViewDown) {
+                    if (image) {
+                        imageWH = (PanoramaGuideViewWOrH * image.size.height)/image.size.width;
+                    }
                     [self.showImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
                         make.height.mas_equalTo(imageWH);
                         make.height.mas_lessThanOrEqualTo(self);
@@ -499,9 +499,10 @@ CGFloat const PanoramaGuideViewWOrH = 120;
                         make.bottom.mas_offset(-imageWH);
                         make.left.mas_equalTo(self.offSetLeft.doubleValue);
                     }];
-                }
-                    break;
-                case PanoramaOrientationViewUp:{
+                } else if (self.orginDir == PanoramaOrientationViewUp) {
+                    if (image) {
+                        imageWH = (PanoramaGuideViewWOrH * image.size.height)/image.size.width;
+                    }
                     [self.showImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
                         make.left.right.top.mas_equalTo(0);
                         make.height.mas_equalTo(imageWH);
@@ -512,10 +513,26 @@ CGFloat const PanoramaGuideViewWOrH = 120;
                         make.left.mas_equalTo(self.offSetLeft.doubleValue);
 
                     }];
-                            
-                }
-                    break;
-                case PanoramaOrientationViewRight: {
+                } else if (self.orginDir == PanoramaOrientationViewLeft) {
+                    
+                    if (image) {
+                        imageWH = (PanoramaGuideViewWOrH * image.size.width)/image.size.height;
+                    }
+                    [self.showImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
+                        make.width.mas_equalTo(imageWH);
+                        make.width.mas_lessThanOrEqualTo(self);
+                        make.left.top.bottom.mas_equalTo(0);
+                    }];
+                    
+                    [self.whiteArrow mas_remakeConstraints:^(MASConstraintMaker *make) {
+                        make.left.mas_offset(imageWH);
+                        make.top.mas_equalTo(self.offSetTop.doubleValue);
+
+                    }];
+                } else if (self.orginDir == PanoramaOrientationViewRight) {
+                    if (image) {
+                        imageWH = (PanoramaGuideViewWOrH * image.size.width)/image.size.height;
+                    }
                     [self.showImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
                         make.width.mas_equalTo(imageWH);
                         make.width.mas_lessThanOrEqualTo(self);
@@ -528,9 +545,101 @@ CGFloat const PanoramaGuideViewWOrH = 120;
 
                     }];
                 }
-                    break;
+                
+            } else if (self.dir == TgDirectionLeft) {
+                if (self.orginDir == PanoramaOrientationViewLeft) {
+                    if (image) {
+                        imageWH = (PanoramaGuideViewWOrH * image.size.height)/image.size.width;
+                    }
+                    [self.showImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
+                        make.left.right.top.mas_equalTo(0);
+                        make.height.mas_equalTo(imageWH);
+                        make.height.mas_lessThanOrEqualTo(self);
+                    }];
+                    [self.whiteArrow mas_remakeConstraints:^(MASConstraintMaker *make) {
+                        make.top.mas_offset(imageWH);
+                        make.left.mas_equalTo(self.offSetLeft.doubleValue);
+
+                    }];
+                } else if (self.orginDir == PanoramaOrientationViewRight) {
+                    if (image) {
+                        imageWH = (PanoramaGuideViewWOrH * image.size.height)/image.size.width;
+                    }
+                    [self.showImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
+                        make.height.mas_equalTo(imageWH);
+                        make.height.mas_lessThanOrEqualTo(self);
+                        make.left.right.bottom.mas_equalTo(0);
+                    }];
+                    [self.whiteArrow mas_remakeConstraints:^(MASConstraintMaker *make) {
+                        make.bottom.mas_offset(-imageWH);
+                        make.left.mas_equalTo(self.offSetLeft.doubleValue);
+                    }];
+                } else if (self.orginDir == PanoramaOrientationViewUp) {
+                    if (image) {
+                        imageWH = (PanoramaGuideViewWOrH * image.size.width)/image.size.height;
+                    }
+                    [self.showImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
+                        make.width.mas_equalTo(imageWH);
+                        make.width.mas_lessThanOrEqualTo(self);
+                        make.top.right.bottom.mas_equalTo(0);
+                    }];
+                    
+                    [self.whiteArrow mas_remakeConstraints:^(MASConstraintMaker *make) {
+                        make.right.mas_offset(-imageWH);
+                        make.top.mas_equalTo(self.offSetTop.doubleValue);
+
+                    }];
+                } else if (self.orginDir == PanoramaOrientationViewDown) {
+
+                    
+                    if (image) {
+                        imageWH = (PanoramaGuideViewWOrH * image.size.width)/image.size.height;
+                    }
+                    [self.showImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
+                        make.width.mas_equalTo(imageWH);
+                        make.width.mas_lessThanOrEqualTo(self);
+                        make.left.top.bottom.mas_equalTo(0);
+                    }];
                     
-                case PanoramaOrientationViewLeft:{
+                    [self.whiteArrow mas_remakeConstraints:^(MASConstraintMaker *make) {
+                        make.left.mas_offset(imageWH);
+                        make.top.mas_equalTo(self.offSetTop.doubleValue);
+
+                    }];
+                }
+                
+            } else if (self.dir == TgDirectionRight) {
+                if (self.orginDir == PanoramaOrientationViewLeft) {
+                    if (image) {
+                        imageWH = (PanoramaGuideViewWOrH * image.size.height)/image.size.width;
+                    }
+                    [self.showImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
+                        make.height.mas_equalTo(imageWH);
+                        make.height.mas_lessThanOrEqualTo(self);
+                        make.left.right.bottom.mas_equalTo(0);
+                    }];
+                    [self.whiteArrow mas_remakeConstraints:^(MASConstraintMaker *make) {
+                        make.bottom.mas_offset(-imageWH);
+                        make.left.mas_equalTo(self.offSetLeft.doubleValue);
+                    }];
+                } else if (self.orginDir == PanoramaOrientationViewRight) {
+                    if (image) {
+                        imageWH = (PanoramaGuideViewWOrH * image.size.height)/image.size.width;
+                    }
+                    [self.showImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
+                        make.left.right.top.mas_equalTo(0);
+                        make.height.mas_equalTo(imageWH);
+                        make.height.mas_lessThanOrEqualTo(self);
+                    }];
+                    [self.whiteArrow mas_remakeConstraints:^(MASConstraintMaker *make) {
+                        make.top.mas_offset(imageWH);
+                        make.left.mas_equalTo(self.offSetLeft.doubleValue);
+
+                    }];
+                } else if (self.orginDir == PanoramaOrientationViewUp) {
+                    if (image) {
+                        imageWH = (PanoramaGuideViewWOrH * image.size.width)/image.size.height;
+                    }
                     [self.showImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
                         make.width.mas_equalTo(imageWH);
                         make.width.mas_lessThanOrEqualTo(self);
@@ -541,14 +650,86 @@ CGFloat const PanoramaGuideViewWOrH = 120;
                         make.left.mas_offset(imageWH);
                         make.top.mas_equalTo(self.offSetTop.doubleValue);
 
+                    }];
+                } else if (self.orginDir == PanoramaOrientationViewDown) {
+
+                    if (image) {
+                        imageWH = (PanoramaGuideViewWOrH * image.size.width)/image.size.height;
+                    }
+                    [self.showImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
+                        make.width.mas_equalTo(imageWH);
+                        make.width.mas_lessThanOrEqualTo(self);
+                        make.top.right.bottom.mas_equalTo(0);
+                    }];
+                    
+                    [self.whiteArrow mas_remakeConstraints:^(MASConstraintMaker *make) {
+                        make.right.mas_offset(-imageWH);
+                        make.top.mas_equalTo(self.offSetTop.doubleValue);
+
                     }];
                 }
+            } else if (self.dir == TgDirectionDown) {
+                if (self.orginDir == PanoramaOrientationViewLeft) {
+
+                    if (image) {
+                        imageWH = (PanoramaGuideViewWOrH * image.size.width)/image.size.height;
+                    }
+                    [self.showImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
+                        make.width.mas_equalTo(imageWH);
+                        make.width.mas_lessThanOrEqualTo(self);
+                        make.top.right.bottom.mas_equalTo(0);
+                    }];
                     
-                    break;
+                    [self.whiteArrow mas_remakeConstraints:^(MASConstraintMaker *make) {
+                        make.right.mas_offset(-imageWH);
+                        make.top.mas_equalTo(self.offSetTop.doubleValue);
+
+                    }];
+                } else if (self.orginDir == PanoramaOrientationViewRight) {
+                    if (image) {
+                        imageWH = (PanoramaGuideViewWOrH * image.size.width)/image.size.height;
+                    }
+                    [self.showImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
+                        make.width.mas_equalTo(imageWH);
+                        make.width.mas_lessThanOrEqualTo(self);
+                        make.left.top.bottom.mas_equalTo(0);
+                    }];
                     
-                default:
-                    break;
+                    [self.whiteArrow mas_remakeConstraints:^(MASConstraintMaker *make) {
+                        make.left.mas_offset(imageWH);
+                        make.top.mas_equalTo(self.offSetTop.doubleValue);
+
+                    }];
+                } else if (self.orginDir == PanoramaOrientationViewUp) {
+                    if (image) {
+                        imageWH = (PanoramaGuideViewWOrH * image.size.height)/image.size.width;
+                    }
+                    [self.showImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
+                        make.height.mas_equalTo(imageWH);
+                        make.height.mas_lessThanOrEqualTo(self);
+                        make.left.right.bottom.mas_equalTo(0);
+                    }];
+                    [self.whiteArrow mas_remakeConstraints:^(MASConstraintMaker *make) {
+                        make.bottom.mas_offset(-imageWH);
+                        make.left.mas_equalTo(self.offSetLeft.doubleValue);
+                    }];
+                } else if (self.orginDir == PanoramaOrientationViewDown) {
+                    if (image) {
+                        imageWH = (PanoramaGuideViewWOrH * image.size.height)/image.size.width;
+                    }
+                    [self.showImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
+                        make.left.right.top.mas_equalTo(0);
+                        make.height.mas_equalTo(imageWH);
+                        make.height.mas_lessThanOrEqualTo(self);
+                    }];
+                    [self.whiteArrow mas_remakeConstraints:^(MASConstraintMaker *make) {
+                        make.top.mas_offset(imageWH);
+                        make.left.mas_equalTo(self.offSetLeft.doubleValue);
+
+                    }];
+                }
             }
+
             [self setNeedsLayout];
             [self layoutIfNeeded];
         }];
@@ -565,25 +746,47 @@ CGFloat const PanoramaGuideViewWOrH = 120;
         if (!self.showImageView.image) {
             return;
         }
-        if (dir == PanoramaOrientationViewDown || dir == PanoramaOrientationViewUp) {
-            if (arrowDir == PanoramaArrowDirCenter) {
-                self.offSetLeft = @((120-38)/2);
-            } else if (arrowDir == PanoramaArrowDirLeft) {
-                self.offSetLeft = @(0);
-            } else if (arrowDir == PanoramaArrowDirRight) {
-                self.offSetLeft = @(120-38);
+        if (self.dir == TgDirectionPortrait || self.dir == TgDirectionDown) {
+            if (dir == PanoramaOrientationViewDown || dir == PanoramaOrientationViewUp) {
+                if (arrowDir == PanoramaArrowDirCenter) {
+                    self.offSetLeft = @((120-38)/2);
+                } else if (arrowDir == PanoramaArrowDirLeft) {
+                    self.offSetLeft = @(0);
+                } else if (arrowDir == PanoramaArrowDirRight) {
+                    self.offSetLeft = @(120-38);
+                }
+            } else if (dir == PanoramaOrientationViewLeft || dir == PanoramaOrientationViewRight) {
+                if (arrowDir == PanoramaArrowDirCenter) {
+                    self.offSetTop = @((120-38)/2);
+                } else if (arrowDir == PanoramaArrowDirUp) {
+                    self.offSetTop = @(0);
+                } else if (arrowDir == PanoramaArrowDirDown) {
+                    self.offSetTop = @(120-38);
+                }
+                
             }
-        }
-        else if (dir == PanoramaOrientationViewLeft || dir == PanoramaOrientationViewRight) {
-            if (arrowDir == PanoramaArrowDirCenter) {
-                self.offSetTop = @((120-38)/2);
-            } else if (arrowDir == PanoramaArrowDirUp) {
-                self.offSetTop = @(0);
-            } else if (arrowDir == PanoramaArrowDirDown) {
-                self.offSetTop = @(120-38);
+        } else if (self.dir == TgDirectionLeft || self.dir == TgDirectionRight) {
+            if (dir == PanoramaOrientationViewLeft || dir == PanoramaOrientationViewRight) {
+                if (arrowDir == PanoramaArrowDirCenter) {
+                    self.offSetLeft = @((120-38)/2);
+                } else if (arrowDir == PanoramaArrowDirLeft) {
+                    self.offSetLeft = @(0);
+                } else if (arrowDir == PanoramaArrowDirRight) {
+                    self.offSetLeft = @(120-38);
+                }
+            } else {
+                if (arrowDir == PanoramaArrowDirCenter) {
+                    self.offSetTop = @((120-38)/2);
+                } else if (arrowDir == PanoramaArrowDirUp) {
+                    self.offSetTop = @(0);
+                } else if (arrowDir == PanoramaArrowDirDown) {
+                    self.offSetTop = @(120-38);
+                }
             }
-            
         }
+        
+        [self showImageWith:self.showImageView.image];
+
     });
 }
 

+ 4 - 2
LenzCameraNativeModuleForRN/Classes/inner/UI/UIView+tool/UIImage+ImageRotate.m

@@ -18,9 +18,11 @@
 
 - (UIImage *)imageRotateWithIndegree:(CGFloat)indegree {
     
+    
+    
     // 1. image --> context
-    size_t width = (size_t)(self.size.width * self.scale);
-    size_t height = (size_t)(self.size.height * self.scale);
+    size_t width = (size_t)(self.size.height * self.scale);
+    size_t height = (size_t)(self.size.width * self.scale);
 
     size_t bytesPerRow = width * 4;                        // 每行图片字节数
     CGImageAlphaInfo alphaInfo = kCGImageAlphaPremultipliedFirst;      // alpha

+ 1 - 1
LenzSDK.podspec

@@ -8,7 +8,7 @@
 
 Pod::Spec.new do |s|
   s.name             = 'LenzSDK'
-  s.version          = '2.2.7'
+  s.version          = '2.2.8'
   s.summary          = 'A short description of LenzSDK.'
 
 # This description is used to generate tags and improve search results.