[Drawkit] DKZoomTool with DKDrawingDocment setFlipped: NO

Graham Cox graham.cox at bigpond.com
Sun Jan 25 22:11:53 PST 2009


On 26 Jan 2009, at 3:53 am, Allan wrote:

> From looking into the GCZoomView code and the DKZoomTool code, I  
> don't see anything there that translates the NSRect and resulting  
> center point based on whether the origin is in the upper left or the  
> lower left. I'm guessing that since the NSView and NSRect assume  
> that the origin is at the upper left, and the setFlipped to NO puts  
> the origin in the lower left that there's a missing piece in here  
> that is needed to correctly calculate the center point in my case.
>
> Is there a different approach that I should take to using the  
> ZoomTool with a not-flipped view? Should I implement a translation  
> in my code? Or is this something that should be handled inside the  
> DKZoomTool?


I'll look into it. The view should zoom correctly regardless, but it  
seems to be making the "flipped" assumption somewhere - I'm not sure  
that either NSView or NSRect do make this assumption, though it's  
possible GCZoomView/DKDrawingView does. I can't quite see where  
though, so I need to investiagte this further. It's fair to say that  
the unflipped case hasn't been extensively tested, I have so far only  
used DK in earnest in the flipped state.

--Graham




More information about the Drawkit mailing list