mirror of
https://github.com/exyte/Macaw.git
synced 2024-10-11 03:49:05 +03:00
Animation fixes
This commit is contained in:
parent
b0f331ff73
commit
61e0bd9c43
@ -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)
|
||||
}
|
||||
|
@ -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)
|
||||
}
|
||||
|
||||
|
@ -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()
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user