A Question about Bezier Paths..
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