Rotating an object
Rotating an object
- Subject: Rotating an object
- From: "Tom Wenger" <email@hidden>
- Date: Thu, 17 Aug 2006 20:59:50 +0530
Hi All,
I am trying to rotate objects with a given angle. I have been
experimenting with sketch sample.
I have modified drawInView function of its graphic class. I can see
the object gets rotated with below code,
but it becomes partially visible (drawing out of bounds).
Below is the code snippet.
(void)drawInView:(SKTGraphicView *)view isSelected:(BOOL)flag
fAngle:(float) fAngle
{
NSBezierPath *path = [self bezierPath];
if (path)
{
if ([self drawsFill])
{
[[self fillColor] set];
[path fill];
}
if ([self drawsStroke])
{
[[self strokeColor] set];
if(fAngle == 45)
{
NSAffineTransform *rotation =
[NSAffineTransform transform];
[rotation rotateByDegrees:fAngle];
[rotation concat];
}
[path stroke];
}
}
if (flag)
{
[self drawHandlesInView:view];
}
}
Any idea on this would be appreciated.
Best Regards.
Tom Wenger.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden