Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between CGAffineTransformMakeRotation and CGAffineTransformRotate

I am starting to play around with Swift's core animation methods and am trying to figure out the difference between these two methods. I succeed in making a square rotate using CGAffineTransformRotate, but I wanted to know what the other was used for.

My best guess is that the CGAffineTransformRotate is performed on something that already has rotated, as it has a parameter that accepts a transform.

like image 570
Cagrosso Avatar asked Sep 06 '25 03:09

Cagrosso


1 Answers

CGAffineTransformMakeRotation( angle ) creates a new affine transform matrix that represents rotation of a fixed angle.

CGAffineTransformRotate( t, angle ) creates an new affine transformation matrix by applying a rotation to an existing affine transform.

like image 159
David Rönnqvist Avatar answered Sep 07 '25 22:09

David Rönnqvist