[Drawkit] Another method for converting distances

Brad Larson larson at sonoplot.com
Mon Jun 29 14:37:35 PDT 2009


While working on a drawing item inspector, I needed to be able to  
convert Quartz distances back to drawing units.  There currently is a  
convertLength: method in DKDrawing that goes one way, but there is  
nothing that reverses that conversion.  I added

- (float)			convertLengthFromDrawingToBase:(float) len
{
	return [[self gridLayer] quartzDistanceForGridDistance:len];
}

to DKDrawing, following the style of the back-and-forth point  
coordinate space conversions.  It might be a nice helper method to add  
to the base DrawKit implementation of this class.


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






More information about the Drawkit mailing list