-
Notifications
You must be signed in to change notification settings - Fork 566
Closed
Milestone
Description
I'm trying to make the SVG animate from one transform matrix to another. Mainly my transform matrices contain just scaling. When I run the following code and tap the svg becomes blurry when scaling up but at the end of the animation it would look correct. The problem is the in-between that is messed up. Is there a way to solve this problem? Am I doing the animation properly?
Example:
class SVGExampleView: MacawView {
var image: Node!
required init?(coder aDecoder: NSCoder) {
image = SVGParser.parse(path: "Animals/duck50x50")!
image.place = .scale(sx: 7, sy: 7)
super.init(node: image, coder: aDecoder)
let gesture = UITapGestureRecognizer(target: self, action: #selector (self.onTap (_:)))
self.addGestureRecognizer(gesture)
}
func onTap(_ sender:UITapGestureRecognizer) {
let toTransform: Transform = .scale(sx: 10, sy: 10)
image.placeVar.animate(from: image.place, to: toTransform, during: 2, delay: 1)
}
}
Reactions are currently unavailable
