diff --git a/Example/Example/Examples/Path/PathExampleView.swift b/Example/Example/Examples/Path/PathExampleView.swift index 63559535..c5609971 100644 --- a/Example/Example/Examples/Path/PathExampleView.swift +++ b/Example/Example/Examples/Path/PathExampleView.swift @@ -232,7 +232,7 @@ class PathExampleView: MacawView { */ - let n = 200 + let n = 40 // let g = 800.0 var clouds = [Node]() for _ in 0 ... (n - 1) { @@ -243,7 +243,7 @@ class PathExampleView: MacawView { observableValue: cloud.posProperty, startValue: Transform.move(0.0, my: 0.0).scale(0.3, sy: 0.3), finalValue: Transform.move(velocity.x, my: velocity.y).scale(0.3, sy: 0.3), - animationDuration: 1.0) + animationDuration: 4.0) animation.append(flying) clouds.append(cloud) } diff --git a/Source/animation/AnimationProducer.swift b/Source/animation/AnimationProducer.swift index 5428353c..fb76b2fc 100644 --- a/Source/animation/AnimationProducer.swift +++ b/Source/animation/AnimationProducer.swift @@ -75,6 +75,7 @@ public class AnimationProducer { group.animations = [translationX, translationY, scaleX, scaleY] group.autoreverses = true group.repeatCount = 100 + group.duration = animation.getDuration() let layer = ShapeLayer() // layer.backgroundColor = UIColor.greenColor().CGColor @@ -82,7 +83,9 @@ public class AnimationProducer { layer.borderColor = UIColor.blueColor().CGColor if let shapeBounds = shape.bounds() { - layer.frame = shapeBounds.cgRect() + print("Shape bounds: \(shapeBounds.description())") + let cgRect = shapeBounds.cgRect() + layer.frame = CGRectMake(0.0, 0.0, cgRect.width, cgRect.height) // layer.frame = CGRectMake(0.0, 0.0, 100.0, 100.0) } diff --git a/Source/render/GroupRenderer.swift b/Source/render/GroupRenderer.swift index dd150924..e1e30045 100644 --- a/Source/render/GroupRenderer.swift +++ b/Source/render/GroupRenderer.swift @@ -1,7 +1,7 @@ import Foundation import UIKit -class GroupRenderer: NodeRenderer { +class GroupRenderer: NodeRenderer { var ctx: RenderContext var node: Node { get { return group } diff --git a/Source/views/ShapeLayer.swift b/Source/views/ShapeLayer.swift index 978632f9..874fd109 100644 --- a/Source/views/ShapeLayer.swift +++ b/Source/views/ShapeLayer.swift @@ -10,6 +10,6 @@ class ShapeLayer: CALayer { let renderContext = RenderContext(view: .None) renderContext.cgContext = ctx - GroupRenderer(group: shape, ctx: renderContext, inBounds: true).render() + GroupRenderer(group: shape, ctx: renderContext, inBounds: false).render() } } \ No newline at end of file