Kuba,
>>> 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.
On the contrary, I don't really see what the code is doing---all of
it appears to be doing nothing more than what is already done in the
redraw code. I commented out everything except for the GXcopy set and
redrawtext() call at the end, and I can't see that anything has changed.
I assume that it is just redundant or unnecessary code.
> A similar areawin->origin manipulation is done in edit() for the LABEL case.
I use areawin->origin mostly to preserve the starting point for moves and
pans, edits and such; it's just a general-purpose placeholder.
> 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.
ULength() is used in the painting code to get the dimensions of a
label, in the window coordinates. It is re-used other places to get
the dimensions of a label in user-space coordinates. It should be
easy enough to let ULength() return only the user coordinates, and
have a separate routine that scales the result according to UTopScale().
Only the latter would be called from the repaint code, presumably.
---Tim
+--------------------------------+-------------------------------------+
| Dr. R. Timothy Edwards (Tim) | email: [email protected] |
| Open Circuit Design, Inc. | web: http://opencircuitdesign.com |
| 22815 Timber Creek Lane | phone: (301) 528-5030 |
| Clarksburg, MD 20871-4001 | cell: (240) 401-0616 |
+--------------------------------+-------------------------------------+
_______________________________________________
Xcircuit-dev mailing list
[email protected]
http://www.opencircuitdesign.com/mailman/listinfo/xcircuit-dev