Re: End type toBezier line.
Re: End type toBezier line.
- Subject: Re: End type toBezier line.
- From: "I. Savant" <email@hidden>
- Date: Sat, 16 Sep 2006 13:48:53 -0400
There's no direct mechanism in NSBezierPath to do this, but adding
"end caps" or whatever you'd like to call them is easy enough. You
already know the end points of your line, so you know where to draw
extra stuff.
You can google around for how to draw more complicated shapes, but
a circle is easy. Say you have an NSPoint called "endPoint".
This is typed in mail and is untested. Beware. :-)
// Make a cap rect, centered on 'endPoint'
float capSize = 2.5f; // or whatever
NSRect capRect = NSZeroRect;
capRect.origin = endPoint;
capRect = NSInsetRect(capRect, -capSize, -capSize); // negative
value expands the rect, rather than insets it
// Now draw the cap
[[NSColor blackColor] set]; // or whatever
[[NSBezierPath bezierPathWithOvalInRect:capRect] fill];
Obviously you'll want to adjust positions, etc, as necessary to
account for antialiasing, etc.
--
I.S.
On Sep 16, 2006, at 9:38 AM, Anoop Thomas varghese wrote:
Hi all,
I am trying to add some end types to either ends of a NSBezierpath
Line.Ineed to add some arrow type or circular end types to
it.I haven't find anything similar to this please let me know if some
default end types like this.
Thanks in advance.
--
Regards,
Anoop T Varghese
Ph:919818134789
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40gmail.com
This email sent to email@hidden
_______________________________________________
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