mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-10-09 03:20:48 +00:00
Video avatar fixes
This commit is contained in:
parent
d07c24be2e
commit
8324c5a55c
@ -38,6 +38,7 @@
|
||||
|
||||
@property (nonatomic, assign) TGPhotoEditorTab availableTabs;
|
||||
|
||||
@property (nonatomic, assign) TGPhotoEditorTab switchingFromTab;
|
||||
@property (nonatomic, assign) TGPhotoEditorTab switchingToTab;
|
||||
|
||||
- (void)transitionOutSwitching:(bool)switching completion:(void (^)(void))completion;
|
||||
|
@ -297,8 +297,16 @@ const CGFloat TGPhotoAvatarPreviewLandscapePanelSize = TGPhotoAvatarPreviewPanel
|
||||
cropScale = _photoEditor.originalSize.width / _photoEditor.cropRect.size.width;
|
||||
}
|
||||
|
||||
UIImageOrientation imageOrientation = _photoEditor.cropOrientation;
|
||||
if ([parentView isKindOfClass:[TGPhotoEditorPreviewView class]])
|
||||
imageOrientation = UIImageOrientationUp;
|
||||
|
||||
CGAffineTransform rotationTransform = CGAffineTransformMakeRotation(TGRotationForOrientation(imageOrientation));
|
||||
if ([parentView isKindOfClass:[TGPhotoEditorPreviewView class]] && _photoEditor.cropMirrored) {
|
||||
rotationTransform = CGAffineTransformMakeScale(-1.0, 1.0);
|
||||
}
|
||||
CGFloat scale = parentView.frame.size.width / _fullEntitiesView.frame.size.width;
|
||||
containerView.transform = CGAffineTransformMakeScale(scale * cropScale, scale * cropScale);
|
||||
containerView.transform = CGAffineTransformScale(rotationTransform, scale * cropScale, scale * cropScale);
|
||||
containerView.frame = CGRectMake(0.0, 0.0, parentView.frame.size.width, parentView.frame.size.height);
|
||||
}
|
||||
|
||||
|
@ -1171,6 +1171,7 @@
|
||||
UIView *snapshotView = nil;
|
||||
|
||||
TGPhotoEditorTabController *currentController = _currentTabController;
|
||||
TGPhotoEditorTab switchingFromTab = TGPhotoEditorNoneTab;
|
||||
if (currentController != nil)
|
||||
{
|
||||
if (![currentController isDismissAllowed])
|
||||
@ -1205,6 +1206,9 @@
|
||||
{
|
||||
_backgroundView.alpha = 0.0f;
|
||||
} completion:nil];
|
||||
switchingFromTab = TGPhotoEditorCropTab;
|
||||
} else if ([currentController isKindOfClass:[TGPhotoToolsController class]]) {
|
||||
switchingFromTab = TGPhotoEditorToolsTab;
|
||||
}
|
||||
|
||||
isInitialAppearance = false;
|
||||
@ -1618,6 +1622,7 @@
|
||||
_currentTabController = controller;
|
||||
_currentTabController.item = _item;
|
||||
_currentTabController.intent = _intent;
|
||||
_currentTabController.switchingFromTab = switchingFromTab;
|
||||
_currentTabController.initialAppearance = isInitialAppearance;
|
||||
|
||||
if (![_currentTabController isKindOfClass:[TGPhotoPaintController class]])
|
||||
|
@ -2326,6 +2326,13 @@ const CGFloat TGPhotoPaintStickerKeyboardSize = 260.0f;
|
||||
|
||||
previewView.frame = previewFrame;
|
||||
|
||||
if ([self presentedForAvatarCreation]) {
|
||||
CGAffineTransform transform = CGAffineTransformMakeRotation(TGRotationForOrientation(photoEditor.cropOrientation));
|
||||
if (photoEditor.cropMirrored)
|
||||
transform = CGAffineTransformScale(transform, -1.0f, 1.0f);
|
||||
previewView.transform = transform;
|
||||
}
|
||||
|
||||
CGSize fittedOriginalSize = CGSizeMake(originalSize.width * ratio, originalSize.height * ratio);
|
||||
CGSize rotatedSize = TGRotatedContentSize(fittedOriginalSize, rotation);
|
||||
CGPoint centerPoint = CGPointMake(rotatedSize.width / 2.0f, rotatedSize.height / 2.0f);
|
||||
|
@ -126,8 +126,8 @@ const CGFloat TGPhotoEditorToolsLandscapePanelSize = TGPhotoEditorToolsPanelSize
|
||||
}
|
||||
|
||||
CGFloat scale = _previewView.frame.size.width / _entitiesView.frame.size.width;
|
||||
_entitiesWrapperView.transform = CGAffineTransformMakeScale(scale * cropScale, scale * cropScale);
|
||||
|
||||
CGAffineTransform rotationTransform = CGAffineTransformMakeRotation(TGRotationForOrientation(_photoEditor.cropOrientation));
|
||||
_entitiesWrapperView.transform = CGAffineTransformScale(rotationTransform, scale * cropScale, scale * cropScale);
|
||||
_entitiesWrapperView.frame = [_previewView convertRect:_previewView.bounds toView:_entitiesWrapperView.superview];
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user