[Drawkit] Another method for converting distances

Graham Cox graham.cox at bigpond.com
Tue Jun 30 21:28:39 PDT 2009


On 30/06/2009, at 7:37 AM, Brad Larson wrote:

> 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.


Added - thanks.

--Graham



More information about the Drawkit mailing list