1
1
mirror of https://github.com/exyte/Macaw.git synced 2024-08-15 08:00:31 +03:00

Fix for animation hierarchy movement

This commit is contained in:
Alisa Mylnikova 2020-04-21 13:59:37 +07:00
parent 5c0f812f0c
commit 67b7bb132f

View File

@ -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