• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Rotating an object
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Rotating an object
      • From: "Shawn Erickson" <email@hidden>
  • Prev by Date: How to render CIImage into CGBitmapContext or NSBitmapImage
  • Next by Date: NSTableView w/Contextual Menu
  • Previous by thread: Re: How to render CIImage into CGBitmapContext or NSBitmapImage
  • Next by thread: Re: Rotating an object
  • Index(es):
    • Date
    • Thread