Generate CATransform3D using two CGrect s?

214 views Asked by At

I have 2 rects: initial and destination ones.

How to create CATransform3D/CGAffineTransform (or transform matrix) which will resize a view from the initial rect to the destination one?

As I understand I should take the initial rect and translate it to (0, 0). Then I should resize the result to the destination rect and then I should move the result to the origin of the destination rect. Although even if this reasoning correct I always make some mistakes in these calculations and I can't achieve the correct result even for origin point.

0

There are 0 answers