@@ -37,7 +37,7 @@ func addShapeAnimation(_ animation: BasicAnimation, sceneLayer: CALayer, animati
3737
3838 // Creating proper animation
3939 let generatedAnim = generateShapeAnimation (
40- from: fromShape ,
40+ from: mutatingShape ,
4141 to: toShape,
4242 duration: duration,
4343 renderTransform: layer. renderTransform!)
@@ -78,6 +78,12 @@ func addShapeAnimation(_ animation: BasicAnimation, sceneLayer: CALayer, animati
7878
7979 if !animation. autoreverses {
8080 let currentShape = shapeAnimation. getVFunc ( ) ( t)
81+ mutatingShape. place = currentShape. place
82+ mutatingShape. opaque = currentShape. opaque
83+ mutatingShape. opacity = currentShape. opacity
84+ mutatingShape. clip = currentShape. clip
85+ mutatingShape. mask = currentShape. mask
86+ mutatingShape. effect = currentShape. effect
8187 mutatingShape. form = currentShape. form
8288 mutatingShape. stroke = currentShape. stroke
8389 mutatingShape. fill = currentShape. fill
@@ -137,6 +143,15 @@ fileprivate func generateShapeAnimation(from: Shape, to: Shape, duration: Double
137143
138144 group. animations = [ pathAnimation]
139145
146+ // Transform
147+ let scaleAnimation = CABasicAnimation ( keyPath: " transform " )
148+ scaleAnimation. duration = duration
149+ let view = nodesMap. getView ( from)
150+ scaleAnimation. fromValue = CATransform3DMakeAffineTransform ( AnimationUtils . absolutePosition ( from, view: view) . toCG ( ) )
151+ scaleAnimation. toValue = CATransform3DMakeAffineTransform ( AnimationUtils . absolutePosition ( to, view: view) . toCG ( ) )
152+
153+ group. animations? . append ( scaleAnimation)
154+
140155 // Fill
141156 let fromFillColor = from. fill as? Color ?? Color . clear
142157 let toFillColor = to. fill as? Color ?? Color . clear
0 commit comments