NSBezierPath geometry question...
NSBezierPath geometry question...
- Subject: NSBezierPath geometry question...
- From: Keith Blount <email@hidden>
- Date: Sun, 10 Apr 2005 14:40:10 -0700 (PDT)
- Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
Hello,
I am trying to use NSBezierPath to create a shape that
highlights text in a text view. Basically, I want to
create a shape that has rounded corners (like the
traditional Apple rounded rectangles you get in Mail
etc), but this may highlight text that spills over
several lines - so the shape is irregular.
This shape is actually defined by several rectangles
that are got using:
NSRectArray rectArray = [layoutManager
rectArrayForCharacterRange:charRange
withinSelectedCharacterRange:NSMakeRange(NSNotFound,0)
inTextContainer:textContainer rectCount:&rectCount];
So what I actually need to do is take the rectangles
returned by this method, create one compound shape
from them, and then round the corners of this shape
into one NSBezierPath.
I have tried several approaches with differing degrees
of succes, such as getting all of the right points
then all of the left points and using
appendBezierPathWithArcFromPoint..., for instance, but
everything I have tried has had some odd effects.
Does anybody know how to take several rects and turn
them into one shape with rounded corners?
Many thanks for any advice,
Keith
__________________________________
Yahoo! Mail Mobile
Take Yahoo! Mail with you! Check email on your mobile phone.
http://mobile.yahoo.com/learn/mail
_______________________________________________
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