From 67b7bb132fed03418e10c57bea470d7adf179171 Mon Sep 17 00:00:00 2001 From: Alisa Mylnikova Date: Tue, 21 Apr 2020 13:59:37 +0700 Subject: [PATCH] Fix for animation hierarchy movement --- Source/views/MacawView.swift | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Source/views/MacawView.swift b/Source/views/MacawView.swift index 582db76a..d957b3e8 100644 --- a/Source/views/MacawView.swift +++ b/Source/views/MacawView.swift @@ -103,23 +103,22 @@ open class MacawView: MView, MGestureRecognizerDelegate { } } - open override func layoutSubviews() { - super.layoutSubviews() - - drawingView.frame = self.bounds - } - func initializeView() { if !self.subviews.contains(drawingView) { if self.backgroundColor == nil { self.backgroundColor = .white } - drawingView.removeFromSuperview() self.addSubview(drawingView) drawingView.backgroundColor = .clear drawingView.initializeView() + drawingView.translatesAutoresizingMaskIntoConstraints = false + drawingView.trailingAnchor.constraint(equalTo: self.trailingAnchor).isActive = true + drawingView.leadingAnchor.constraint(equalTo: self.leadingAnchor).isActive = true + drawingView.bottomAnchor.constraint(equalTo: self.bottomAnchor).isActive = true + drawingView.topAnchor.constraint(equalTo: self.topAnchor).isActive = true + #if os(iOS) self.clipsToBounds = true drawingView.isUserInteractionEnabled = false