Various fixes

This commit is contained in:
Ilya Laktyushin
2022-12-22 16:42:13 +04:00
parent 36918ecaf9
commit 1798554940
47 changed files with 1389 additions and 942 deletions

View File

@@ -30,7 +30,7 @@
const CGFloat TGPhotoPaintTopPanelSize = 44.0f;
const CGFloat TGPhotoPaintBottomPanelSize = 79.0f;
const CGSize TGPhotoPaintingLightMaxSize = { 1280.0f, 1280.0f };
const CGSize TGPhotoPaintingMaxSize = { 2560.0f, 2560.0f };
const CGSize TGPhotoPaintingMaxSize = { 1920.0f, 1920.0f };
@interface TGPhotoDrawingController () <UIScrollViewDelegate, UIGestureRecognizerDelegate>
{
@@ -85,7 +85,7 @@ const CGSize TGPhotoPaintingMaxSize = { 2560.0f, 2560.0f };
_stickersContext = stickersContext;
CGSize size = TGScaleToSize(photoEditor.originalSize, [TGPhotoDrawingController maximumPaintingSize]);
_drawingAdapter = [_stickersContext drawingAdapter:size originalSize:photoEditor.originalSize isAvatar:isAvatar];
_drawingAdapter = [_stickersContext drawingAdapter:size originalSize:photoEditor.originalSize isVideo:photoEditor.forVideo isAvatar:isAvatar];
_interfaceController = (UIViewController<TGPhotoDrawingInterfaceController> *)_drawingAdapter.interfaceController;
__weak TGPhotoDrawingController *weakSelf = self;
@@ -108,6 +108,13 @@ const CGSize TGPhotoPaintingMaxSize = { 2560.0f, 2560.0f };
return [strongSelf.photoEditor currentResultImage];
};
_interfaceController.updateVideoPlayback = ^(bool play) {
__strong TGPhotoDrawingController *strongSelf = weakSelf;
if (strongSelf == nil)
return;
strongSelf.controlVideoPlayback(play);
};
self.photoEditor = photoEditor;
self.previewView = previewView;
@@ -474,6 +481,7 @@ const CGSize TGPhotoPaintingMaxSize = { 2560.0f, 2560.0f };
- (void)transitionIn {
[_context lockPortrait];
[_context disableInteractiveKeyboardGesture];
// if (self.presentedForAvatarCreation) {
// _drawingView.hidden = true;
// }
@@ -900,6 +908,7 @@ const CGSize TGPhotoPaintingMaxSize = { 2560.0f, 2560.0f };
- (CGPoint)entityCenterPoint
{
//return [_scrollView convertPoint:TGPaintCenterOfRect(_scrollView.bounds) toView:_entitiesView];
return [_previewView convertPoint:TGPaintCenterOfRect(_previewView.bounds) toView:_entitiesView];
}