Various fixes

This commit is contained in:
Ilya Laktyushin
2022-12-23 10:11:08 +04:00
parent 729b4d952c
commit 9937826307
30 changed files with 484 additions and 2603 deletions

View File

@@ -365,14 +365,12 @@ public final class DrawingView: UIView, UIGestureRecognizerDelegate, TGPhotoDraw
self.strokeRecognitionTimer?.invalidate()
}
public func setup(withDrawing drawingData: Data!) {
public func setup(withDrawing drawingData: Data?) {
if let drawingData = drawingData, let image = UIImage(data: drawingData) {
self.hasOpaqueData = true
self.drawingImage = image
self.layer.contents = image.cgImage
//let codableElements = try? JSONDecoder().decode([CodableDrawingElement].self, from: drawingData) {
//self.elements = codableElements.map { $0.element }
//self.commit(reset: true)
self.updateInternalState()
}
}