Re: NSBezierPath winding rules and glyphs
Re: NSBezierPath winding rules and glyphs
- Subject: Re: NSBezierPath winding rules and glyphs
- From: Joakim Johansson <email@hidden>
- Date: Mon, 24 Mar 2003 22:57:30 +0100
On svndag, mar 23, 2003, at 18:52 Europe/Stockholm, Brock Brandenberg
wrote:
So, the only way to get a
filled center is to set to NSNonZeroWindingRule and reverse the
interior
bezier path directions manually so that they all wind in the same
direction.
This is not trivial, and unfortunately I don't have an immediate
solution to
suggest.
That was more or less where I ended up - it does not feel like a
reasonable solution to this "simple" problem.
I must confess I wonder a bit over there not being a
"NSUnconditionalWindingRule" - it seems as a (sometimes) useful thing
to have and it by gut feeling it seems simpler than the existing
winding rules.
A commonly used technique, though, is to stroke the paths with an
opposite
color before filling to give the path a "halo" or outline effect. The
pointer cursor uses this trick so that it's visible on any background,
and
it doesn't require you to do any winding rule manipulation. It looks
like
you are stoking the path now, but are you doing it in an opposite
color?
Well, I have done that for other applications back in the DPS days, but
it is simply not useful for this application. The sample snippet I
posted is really not the code I currently use (I use Quartz 2D directly
at the moment, but thought I would migrate over to NSBezierPath
together with a cached pre-rendered NSImage representation for maximum
performance if it helped solve this problem...).
Thanks,
Joakim
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.