• 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
A Question about Bezier Paths..
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

A Question about Bezier Paths..


  • Subject: A Question about Bezier Paths..
  • From: "Brian O'Brien" <email@hidden>
  • Date: Fri, 1 Apr 2005 14:14:36 -0700

I've written this code to draw an oval and I want to draw 4 small squares at the corners of the bounding box of the oval.
However the boxes all appear at the origin. (Perhaps I need to do some translations?)

- (void) drawRect:(NSRect) rects
{
[super drawRect:rects];

NSRect aRect = NSMakeRect(0.0, 0.0, 50.0, 50.0);
NSRect aSmallCtrlPoint = NSMakeRect(0.0, 0.0, 10.0, 10.0);

NSAffineTransform *transform = [NSAffineTransform transform];
NSBezierPath *mainPath = [NSBezierPath bezierPath];

[[NSColor greenColor] set];

[mainPath appendBezierPathWithOvalInRect:aRect];

[mainPath moveToPoint:bl];
[mainPath appendBezierPathWithRect:aSmallCtrlPoint];
[mainPath moveToPoint:br];
[mainPath appendBezierPathWithRect:aSmallCtrlPoint];
[mainPath moveToPoint:tl];
[mainPath appendBezierPathWithRect:aSmallCtrlPoint];
[mainPath moveToPoint:tr];
[mainPath appendBezierPathWithRect:aSmallCtrlPoint];


[mainPath stroke];
}
 _______________________________________________
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: A Question about Bezier Paths..
      • From: Shawn Erickson <email@hidden>
  • Prev by Date: NSTextView undo doesn't work for attributes?
  • Next by Date: U3D File Format
  • Previous by thread: Re: Working with icns files in Cocoa
  • Next by thread: Re: A Question about Bezier Paths..
  • Index(es):
    • Date
    • Thread