[Drawkit] two views, different layers?

Graham Cox graham.cox at bigpond.com
Tue Jul 29 19:12:24 PDT 2008


On 30 Jul 2008, at 12:00 pm, James Maxwell wrote:

> oh, I actually wound up doing it in my DKToolController subclass'  
> mouseDown, as I haven't subclassed DKDrawingView, at this point.  
> (And I'm kind of trying not to!)
> Does it make much difference to do it in the tool controller, rather  
> than the view?

No, that's fine, and probably more correct anyway.

> What I've done seems okay, from the little bit of testing I've done,  
> so far. I had to fudge around a bit to get changes across the layers  
> to undo properly... or rather, to redraw the display properly after  
> undoing. This seemed to be because objects on an inactive layer were  
> getting undone, and weren't being told to redraw immediately after  
> the undo...

Congratulations, you found a bug ;-)

In Beta 4 I turned on inactive layer caching by default, but turns out  
this isn't quite playing nice with undo. I will fix it, but for now I  
suggest you turn off the caching (in DKObjectOwnerLayer's init method,  
comment out [self setLayerCacheOption:kDKLayerCacheUsingPDF]; (or  
change the value to kDKLayerCacheNone)


cheers, Graham




More information about the Drawkit mailing list