1
1
mirror of https://github.com/exyte/Macaw.git synced 2024-09-11 13:15:35 +03:00

Previously animated nodes fix

This commit is contained in:
Viktor Sukochev 2017-07-05 12:02:43 +07:00
parent db33ca09ec
commit 2518621eaa

View File

@ -139,6 +139,10 @@ open class MacawView: UIView, UIGestureRecognizerDelegate {
let animatedNodes = AnimationUtils.animatedNodes(root: node, animationCache: cache)
defer {
prevAnimatedNodes = animatedNodes
}
// No animation case
if animatedNodes.count == 0 || animatedNodes.count > 20 {
zLayers.forEach { $0.removeFromSuperlayer() }
@ -167,7 +171,6 @@ open class MacawView: UIView, UIGestureRecognizerDelegate {
// Removing old ones
zLayers.forEach { $0.removeFromSuperlayer() }
zLayers.removeAll()
prevAnimatedNodes = animatedNodes
// Adding new
var indexCache = [Node: Int]()