Various improvements

This commit is contained in:
Ilya Laktyushin
2022-12-21 02:08:39 +04:00
parent 5fe2e3f69b
commit b5c35cd8e7
30 changed files with 1151 additions and 465 deletions

View File

@@ -219,6 +219,22 @@ const CGSize TGPhotoPaintingMaxSize = { 2560.0f, 2560.0f };
strongSelf->_scrollView.pinchGestureRecognizer.enabled = !hasSelection;
};
_entitiesView.getEntityCenterPosition = ^CGPoint {
__strong TGPhotoDrawingController *strongSelf = weakSelf;
if (strongSelf == nil)
return CGPointZero;
return [strongSelf entityCenterPoint];
};
_entitiesView.getEntityInitialRotation = ^CGFloat {
__strong TGPhotoDrawingController *strongSelf = weakSelf;
if (strongSelf == nil)
return 0.0f;
return [strongSelf entityInitialRotation];
};
[self.view setNeedsLayout];
}
@@ -771,6 +787,7 @@ const CGSize TGPhotoPaintingMaxSize = { 2560.0f, 2560.0f };
safeInsets:UIEdgeInsetsMake(0.0, _context.safeAreaInset.left, 0.0, _context.safeAreaInset.right)
statusBarHeight:[_context statusBarFrame].size.height
inputHeight:_keyboardHeight
orientation:self.effectiveOrientation
animated:animated];
}
@@ -878,6 +895,16 @@ const CGSize TGPhotoPaintingMaxSize = { 2560.0f, 2560.0f };
return UIRectEdgeTop | UIRectEdgeBottom;
}
- (CGPoint)entityCenterPoint
{
return [_previewView convertPoint:TGPaintCenterOfRect(_previewView.bounds) toView:_entitiesView];
}
- (CGFloat)entityInitialRotation
{
return TGCounterRotationForOrientation(_photoEditor.cropOrientation) - _photoEditor.cropRotation;
}
+ (CGSize)maximumPaintingSize
{
static dispatch_once_t onceToken;