added command `xschem set crosshair_layer` to change layer used for crosshair drawing

This commit is contained in:
stefan schippers 2025-01-21 16:50:31 +01:00
parent 7ee11e8dbc
commit 1015a9d71e
2 changed files with 9 additions and 0 deletions

View File

@ -1438,6 +1438,7 @@ C {verilog_timescale.sym} 1050 -100 0 0 {name=s1 timestep="1ns" precision="1ns"
<li><kbd> cadgrid </kbd> set cad grid (default: 20) </li>
<li><kbd> cadsnap </kbd> set mouse snap (default: 10) </li>
<li><kbd> color_ps </kbd> set color psoscript (1 or 0) </li>
<li><kbd> crosshair_layer </kbd> set layer for mouse crosshair </li>
<li><kbd> constr_mv </kbd> set constrained move (1=horiz, 2=vert, 0=none) </li>
<li><kbd> cursor1_x </kbd> set graph cursor1 position </li>
<li><kbd> cursor2_x </kbd> set graph cursor2 position </li>

View File

@ -5081,8 +5081,16 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
else if(!strcmp(argv[2], "color_ps")) { /* set color psoscript (1 or 0) */
color_ps=atoi(argv[3]);
}
else if(!strcmp(argv[2], "crosshair_layer")) { /* set layer for mouse crosshair */
int c = atoi(argv[3]);
tclsetintvar("crosshair_layer", c);
xctx->crosshair_layer = c;
if(xctx->crosshair_layer < 0 ) xctx->crosshair_layer = 2;
if(xctx->crosshair_layer >= cadlayers ) xctx->crosshair_layer = 2;
}
else if(!strcmp(argv[2], "constr_mv")) { /* set constrained move (1=horiz, 2=vert, 0=none) */
xctx->constr_mv = atoi(argv[3]);
if(xctx->constr_mv < 0 || xctx->constr_mv > 2) xctx->constr_mv = 0;
}
else if(!strcmp(argv[2], "cursor1_x")) { /* set graph cursor1 position */
xctx->graph_cursor1_x = atof_spice(argv[3]);