Various fixes

This commit is contained in:
Ilya Laktyushin
2022-12-19 16:08:43 +04:00
parent 29f7c8c9f0
commit 8a9a557870
5 changed files with 31 additions and 14 deletions

View File

@@ -268,6 +268,10 @@ public final class DrawingView: UIView, UIGestureRecognizerDelegate, TGPhotoDraw
}
if let renderLayer = newElement.setupRenderLayer() {
if let currentDrawingLayer = strongSelf.currentDrawingLayer {
strongSelf.currentDrawingLayer = nil
currentDrawingLayer.removeFromSuperlayer()
}
strongSelf.currentDrawingView.layer.addSublayer(renderLayer)
strongSelf.currentDrawingLayer = renderLayer
}