diff --git a/submodules/DrawingUI/Sources/DrawingView.swift b/submodules/DrawingUI/Sources/DrawingView.swift index 3a5f2d8834..c4a2bdadd7 100644 --- a/submodules/DrawingUI/Sources/DrawingView.swift +++ b/submodules/DrawingUI/Sources/DrawingView.swift @@ -675,13 +675,14 @@ public final class DrawingView: UIView, UIGestureRecognizerDelegate, TGPhotoDraw } private func prepareNewElement() -> DrawingElement? { + let scale = 1.0 / self.zoomScale let element: DrawingElement? switch self.tool { case .pen: let penTool = PenTool( drawingSize: self.imageSize, color: self.toolColor, - lineWidth: self.toolBrushSize, + lineWidth: self.toolBrushSize * scale, arrow: self.toolHasArrow ) element = penTool @@ -689,7 +690,7 @@ public final class DrawingView: UIView, UIGestureRecognizerDelegate, TGPhotoDraw let markerTool = MarkerTool( drawingSize: self.imageSize, color: self.toolColor, - lineWidth: self.toolBrushSize, + lineWidth: self.toolBrushSize * scale, arrow: self.toolHasArrow ) markerTool.metalView = self.metalView @@ -698,14 +699,14 @@ public final class DrawingView: UIView, UIGestureRecognizerDelegate, TGPhotoDraw element = NeonTool( drawingSize: self.imageSize, color: self.toolColor, - lineWidth: self.toolBrushSize, + lineWidth: self.toolBrushSize * scale, arrow: self.toolHasArrow ) case .pencil: let pencilTool = PencilTool( drawingSize: self.imageSize, color: self.toolColor, - lineWidth: self.toolBrushSize, + lineWidth: self.toolBrushSize * scale, arrow: self.toolHasArrow ) pencilTool.metalView = self.metalView @@ -714,7 +715,7 @@ public final class DrawingView: UIView, UIGestureRecognizerDelegate, TGPhotoDraw let blurTool = BlurTool( drawingSize: self.imageSize, color: self.toolColor, - lineWidth: self.toolBrushSize, + lineWidth: self.toolBrushSize * scale, arrow: false) blurTool.getFullImage = { [weak self] in return self?.preparredEraserImage @@ -724,7 +725,7 @@ public final class DrawingView: UIView, UIGestureRecognizerDelegate, TGPhotoDraw let eraserTool = EraserTool( drawingSize: self.imageSize, color: self.toolColor, - lineWidth: self.toolBrushSize, + lineWidth: self.toolBrushSize * scale, arrow: false) eraserTool.getFullImage = { [weak self] in return self?.preparredEraserImage diff --git a/submodules/LegacyComponents/Sources/TGPhotoDrawingController.m b/submodules/LegacyComponents/Sources/TGPhotoDrawingController.m index 53da33030f..4c956f2500 100644 --- a/submodules/LegacyComponents/Sources/TGPhotoDrawingController.m +++ b/submodules/LegacyComponents/Sources/TGPhotoDrawingController.m @@ -218,16 +218,6 @@ [self.view setNeedsLayout]; } -- (void)viewDidLoad -{ - [super viewDidLoad]; - -// PGPhotoEditor *photoEditor = _photoEditor; -// if (!_skipEntitiesSetup) { -// [_entitiesView setupWithPaintingData:photoEditor.paintingData]; -// } -} - - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; diff --git a/submodules/LegacyComponents/Sources/TGPhotoPaintController.m b/submodules/LegacyComponents/Sources/TGPhotoPaintController.m index 7d882e38f3..18333b75ee 100644 --- a/submodules/LegacyComponents/Sources/TGPhotoPaintController.m +++ b/submodules/LegacyComponents/Sources/TGPhotoPaintController.m @@ -54,7 +54,7 @@ const CGFloat TGPhotoPaintTopPanelSize = 44.0f; const CGFloat TGPhotoPaintBottomPanelSize = 79.0f; const CGSize TGPhotoPaintingLightMaxSize = { 1280.0f, 1280.0f }; -const CGSize TGPhotoPaintingMaxSize = { 1920.0f, 1920.0f }; +const CGSize TGPhotoPaintingMaxSize = { 2560.0f, 2560.0f }; const CGFloat TGPhotoPaintStickerKeyboardSize = 260.0f;