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:
parent
ac16998bba
commit
015fe3f44a
@ -10,7 +10,6 @@ public class AnimationProducer {
|
||||
}
|
||||
|
||||
public func addAnimation(animation: Animatable) {
|
||||
animation.node?.animating = true
|
||||
|
||||
switch animation.type {
|
||||
case .Unknown:
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
|
@ -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?()
|
||||
|
@ -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?()
|
||||
|
@ -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 }
|
||||
|
@ -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) }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user