Проверить это в Apple documentation.
applyTransform:
Превращает все точки на пути, используя указанный аффинное преобразование матрицы.
- (void)applyTransform:(CGAffineTransform)transform
Я еще не пробовал. Но вот как повернуть NSBezierPath
со ссылкой rotating-nsbezierpath-objects. Попробуйте использовать аналогичный подход на UIBezierPath
.
- (NSBezierPath*)rotatedPath:(CGFloat)angle aboutPoint:(NSPoint)cp
{
// return a rotated copy of the receiver. The origin is taken as point <cp> relative to the original path.
// angle is a value in radians
if(angle == 0.0)
return self;
else
{
NSBezierPath* copy = [self copy];
NSAffineTransform* xfm = RotationTransform(angle, cp);
[copy transformUsingAffineTransform:xfm];
return [copy autorelease];
}
}
, который использует:
NSAffineTransform *RotationTransform(const CGFloat angle, const NSPoint cp)
{
// return a transform that will cause a rotation about the point given at the angle given
NSAffineTransform* xfm = [NSAffineTransform transform];
[xfm translateXBy:cp.x yBy:cp.y];
[xfm rotateByRadians:angle];
[xfm translateXBy:-cp.x yBy:-cp.y];
return xfm;
}