I don’t understand how to apply “CGAffineTransform” parameter that appears in practically every CGPath method, e.g.:
void CGPathAddRect (
CGMutablePathRef path,
const CGAffineTransform *m,
CGRect rect
);
Let’s say I want to rotate a rect path, how would I write out this function? Where to I get the transform matrix?
You use use CGAffineTransformMakeRotation to create a CGAffineTransform that rotates the rectangle about the point (0, 0).
If you need it to rotate about any other points (x, y), you need to compose 2 translations to move (x, y) to (0, 0) and back.