HeroTransitions / Hero

Elegant transition library for iOS & tvOS
https://HeroTransitions.github.io/Hero/
MIT License
22k stars 1.72k forks source link

The layer property `anchorPoint` animation does not work. #741

Closed cloxnu closed 1 year ago

cloxnu commented 1 year ago

The layer property anchorPoint animation does not work, it is set to the value of the last frame at the start of the animation

What did you do?

// ViewController 1
let view1 = UIView()
view1.heroID = "view"
view1.bounds.size = CGSize(width: 100, height: 100)
view1.layer.anchorPoint = CGPoint(x: 0.5, y: 0.5)
view1.layer.position = CGPoint(x: 100, y: 100)

// ViewController 2
let view2 = UIView()
view2.heroID = "view"
view2.bounds.size = CGSize(width: 100, height: 100)
view2.layer.anchorPoint = CGPoint(x: 0, y: 0)
view2.layer.position = CGPoint(x: 200, y: 200)

What did you expect to happen?

view1 transition to view2 smoothly.

What happened instead?

The anchorPoint of view2 is set to the value of the last frame at the start of the transition.

https://user-images.githubusercontent.com/33758521/187088860-f3fbfdd2-cb2d-4ea2-aac7-6ee9e3085045.mov

General Information