Reworked the way that magic displays measurement values (both linear

and area) so that they are consistent across commands.  The default
behavior remains the same, for backwards compatibility.  However, a
new "units" command has been added, so that "units microns" results
in measurements always being displayed in microns, with choice of
that or "internal", "lambda", or "grid".  The units themselves may
be printed (for interactive use) or not (for scripted use).  The
use of "units" is independent of "snap", after overriding the
default behavior, so that units parsed on the command line are
interpreted according to "units", not to "snap".
This commit is contained in:
R. Timothy Edwards
2026-01-24 16:19:12 -05:00
parent 8822f8dce2
commit 81436b75ed
17 changed files with 894 additions and 234 deletions
+11 -4
View File
@@ -694,15 +694,22 @@ w3dCutBox(w, cmd)
{
if (crec->clipped)
{
char *cllx, *clly, *curx, *cury;
cllx = DBWPrintValue(crec->cutbox.r_xbot, w, TRUE);
clly = DBWPrintValue(crec->cutbox.r_ybot, w, TRUE);
curx = DBWPrintValue(crec->cutbox.r_xtop, w, TRUE);
cury = DBWPrintValue(crec->cutbox.r_ytop, w, TRUE);
Tcl_Obj *rlist = Tcl_NewListObj(0, NULL);
Tcl_ListObjAppendElement(magicinterp, rlist,
Tcl_NewIntObj((int)(crec->cutbox.r_xbot)));
Tcl_NewStringObj(cllx, -1));
Tcl_ListObjAppendElement(magicinterp, rlist,
Tcl_NewIntObj((int)(crec->cutbox.r_ybot)));
Tcl_NewStringObj(clly, -1));
Tcl_ListObjAppendElement(magicinterp, rlist,
Tcl_NewIntObj((int)(crec->cutbox.r_xtop)));
Tcl_NewStringObj(curx, -1));
Tcl_ListObjAppendElement(magicinterp, rlist,
Tcl_NewIntObj((int)(crec->cutbox.r_ytop)));
Tcl_NewStringObj(cury, -1));
Tcl_SetObjResult(magicinterp, rlist);
}