On Nov 11, 2010, at 12:35 PM, Kuba Ober wrote: >> labeltext() is called plenty from various non-repaint events, so it can't >> really be made to depend on a context. >> >> Yet it is calling ULength(), the latter depending on the drawing context for >> the >> scaling factor. >> >> Any ideas how to decouple that? I haven't looked very closely, I admit. > > Further note: the code in question is below the telling comment > /* Redraw the label */ -- so it should be removed, preserving any side > effects. > It appears to have no side effects besides moving the origin of the areawin, > thus I put it into an #if 0 block. I presume that this code intends to keep > the label > visible in the window while you edit it.
I guess I was wrong. areawin->origin is used often in editing and selection code. So this is nothing about keeping stuff visible I'd guess, and this code needs to be preserved. A similar areawin->origin manipulation is done in edit() for the LABEL case. I will simply create a local context for that, since the first thing the context does is to call UMakeWCTM() on the top of matStack. So this is no biggie, apparently, as long as it checks works ;) Methinks that ULength() and its ilk care for, when called from a random non-repaint event, is the WCTM -- as there would be nothing else on the MatStack at that time. Cheers, Kuba _______________________________________________ Xcircuit-dev mailing list [email protected] http://www.opencircuitdesign.com/mailman/listinfo/xcircuit-dev
