Not trying to be rude here, but this is so confused that it is hard to
figure out what you are trying to do.
* What do you mean by "light drawing functions" ?
* What is "self" here ? What object is this a method for ?
* If you are trying to draw, where is the connection to the location
information in the mouse event ?
* Why are you trying to add a rectangle to the end of the path ??
( appendBezierPathWithRect: )
* If you're worried that "penPath" is nil and you're going do a
special test to bug out because of it, you should do it at the top,
not in the middle.
* What do you mean by "free form" ?
If you mean a "pen tool" as it is called in most drawing programs, you
have to capture the mouse clicks and/or drags and the create Bezier
curves using the successive values as control points. If you mean a
freehand "pencil tool", the usual way is to capture the sequence of
mouse dragged events (which implicitly define a polyline) and then fit
a chain of Bezier curves to it. There is Bezier fitting code in one of
the Graphics Gems books. (The code is online - Google Graphic Gems fit
Bezier). You'll have to adapt it to produce NSBezierPath's and play
with the tolerences to get the result you want.
I'm sure this is a simple problem
What evidence, exactly, do you have for this proposition ? ;-)
_______________________________________________
Cocoa-dev mailing list ([email protected])
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [EMAIL PROTECTED]