Kuba,

> I don't understand why the case for FONT_SCALE in ULength
> multiplies strscale by UTopScale.
> 
> With given newscale > 0.0, the initial scales are all set to UTopScale * 
> newscale.
> So suppose the first string part is FONT_SCALE of s.
> 
> Then we have
> 
> strscale = (UTopScale * newscale) * s;
> followed by
> natscale = strscale;
> since initial ykern will be 0.0.
> Finally
> strscale = ((UTopScale * newscale) * s) * UTopScale
> 
> It looks like you're trying to interpret FONT_SCALE in some absolute
> terms (like a point size rather than scale). Otherwise this code
>           if (newscale > 0.0)
>                strscale *= UTopScale();
> is simply spurious.
> 
> Am I missing something? Is the scale in to FONT_SCALE stringpart
> pre-divided by UTopScale() perhaps? I'm trying to make sure I know
> what I'm doing here.

I made a few text labels with font size changes in the middle of the
text.  Then I checked when ULength() was being called with
newscale != 0.  It turns out that the only one left (after commenting
out the block in elements.c that you pointed out yesterday, which
contains two occurrences and appears to suffer no ill effects from
being removed) is in events.c, line 3429 (in the original C source
for xcircuit 3.7), and it looks suspiciously like the block of code
in elements.c.  So I commented it out (everything from the call to
ULength to the call to pinadjust).  Perhaps unsurprisingly, there
was once again no ill effect.  I tried a number of variations that
might be affected by the edit command, the areawin->origin value,
and the position as corrected by pinadjust(), and nothing makes any
difference.  I did find that there is an error in the way xcircuit
calculates the position in the string to start editing, but that
error exists regardless of what's done with the bits of code in
question (in fact, there seem to be two or three separate errors,
but that's a separate issue, and one that is likely to be easier
to track down after this mess of code is cleaned up).

Consequently, I recommend removing all those blocks of apparently
useless code, removing "newscale" from the argument list to ULength(),
and rewriting ULength() assuming newlength = 0.0 always.  That will
make everything much cleaner.

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

Reply via email to