1
1
mirror of https://github.com/exyte/Macaw.git synced 2024-09-21 18:09:21 +03:00

Node animating property removed

This commit is contained in:
Victor Sukochev 2016-08-03 14:16:01 +06:00
parent ac16998bba
commit 015fe3f44a
6 changed files with 12 additions and 8 deletions

View File

@ -10,7 +10,6 @@ public class AnimationProducer {
}
public func addAnimation(animation: Animatable) {
animation.node?.animating = true
switch animation.type {
case .Unknown:

View File

@ -40,6 +40,8 @@ class AnimationCache {
sceneLayer?.addSublayer(layer)
layerCache[node] = CachedLayer(layer: layer)
return layer
}
@ -65,4 +67,12 @@ class AnimationCache {
layerCache.removeValueForKey(node)
}
}
func isAnimating(node: Node) -> Bool {
if let _ = layerCache[node] {
return true
}
return false
}
}

View File

@ -27,7 +27,6 @@ func addOpacityAnimation(animation: Animatable, sceneLayer: CALayer) {
animation.node?.opacityVar.value = opacityAnimation.vFunc(animation.progress)
}
animation.node?.animating = false
animationCache.freeLayer(node)
animation.completion?()

View File

@ -33,7 +33,6 @@ func addTransformAnimation(animation: Animatable, sceneLayer: CALayer) {
animation.node?.posVar.value = transformAnimation.vFunc(animation.progress)
}
animation.node?.animating = false
animationCache.freeLayer(node)
animation.completion?()

View File

@ -3,9 +3,6 @@ import RxSwift
public class Node: Drawable {
// TODO: remove me please!
public var animating: Bool = false
public let posVar: Variable<Transform>
public var pos: Transform {
get { return posVar.value }

View File

@ -31,12 +31,12 @@ class GroupRenderer: NodeRenderer {
if !force {
// Cutting animated content
if group.animating {
if animationCache.isAnimating(group) {
return
}
}
let staticContents = group.contentsVar.filter { !$0.animating }
let staticContents = group.contentsVar.filter { !animationCache.isAnimating($0) }
let contentRenderers = staticContents.map { RenderUtils.createNodeRenderer($0, context: ctx) }