mirror of
https://github.com/RTimothyEdwards/magic.git
synced 2026-08-29 01:24:51 +02:00
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:
+11
-4
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user