[Drawkit] DrawKit Beta 5 available

Brad Larson larson at sonoplot.com
Mon Jan 12 11:50:52 PST 2009


There's a slight fix that I had incorporated in my patched Beta 4 for  
DKArcPath for the case where a user is drawing a circle.  Sometimes,  
they would pick the arc tool and draw an arc by clicking on the center  
point, moving to set the radius, clicking on that point, and then  
quickly clicking again without moving the mouse.  Onscreen, this  
leaves behind a circle, but if you go to save the drawing it is output  
as a semicircle or something else.

I found that by adding the line

mStartAngle = mEndAngle + 2 * M_PI;

within the -arcCreateLoop: method at the following position:

		switch ([theEvent type])
		{
			case NSLeftMouseDown:
			{
				if ( phase == 0 )
				{
					// set radius as the distance from this click to the centre, and  
the
					// start angle based on the slope of this line
					
					mRadius = hypotf( p.x - mCentre.x, p.y - mCentre.y );
					mEndAngle = atan2f( p.y - mCentre.y, p.x - mCentre.x );
					mStartAngle = mEndAngle + 2 * M_PI;
					++phase;	// now setting the arc
					
					if([self arcType] == kDKArcPathCircle )
						loop = NO;
				}
				else
					loop = NO;
			}
			break;

the arcs seem to work correctly.  I think that if the user does not  
move the mouse after setting the radius of the arc, mStartAngle is  
never set properly.  Since we use the start and end angles to write  
arcs out to our pattern files, rather than the Bezier paths, this was  
causing some weirdness.



On Jan 6, 2009, at 8:58 PM, Graham Cox wrote:

> Hi All,
>
> Sorry it's taken so long to get a new beta release together, but I  
> have been buried in work....
>
> B5 can now be downloaded from the usual address:
>
> http://apptree.net/drawkitmain.htm
>
> There have been quite a few changes and lots of your suggestions and  
> contributions have been incorporated. Many thanks for your  
> continuing interest!
>
> cheers, Graham
>
>
> _______________________________________________
> Drawkit mailing list
> Drawkit at lists.apptree.net
> http://lists.apptree.net/listinfo.cgi/drawkit-apptree.net

______________________
Brad Larson, Ph.D.
SonoPlot, Inc.
3030 Laura Lane, Suite 120
Middleton, WI 53562






More information about the Drawkit mailing list