add xschemrc variable zoom_full_center, if set to 1 full zoom will center the schematic instead of anchoring to lower-left drawing area corner.

This commit is contained in:
stefan schippers 2023-03-09 22:48:25 +01:00
parent 832e89ce1b
commit 25f34ee413
4 changed files with 12 additions and 4 deletions

View File

@ -2377,12 +2377,14 @@ int callback(const char *winpath, int event, int mx, int my, KeySym key,
break;
}
if(key=='f' && state == 0 ) /* full zoom */
{
{
int flags = 1;
if(waves_selected(event, key, state, button)) {
waves_callback(event, mx, my, key, button, aux, state);
break;
}
zoom_full(1, 0, 1, 0.97);
if(tclgetboolvar("zoom_full_center")) flags |= 2;
zoom_full(1, 0, flags, 0.97);
break;
}
if((key=='z' && state==ControlMask)) /* zoom out */

View File

@ -3594,6 +3594,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
if(endptr == argv[i]) shrink = 1.0;
}
}
if(tclgetboolvar("zoom_full_center")) flags |= 2;
zoom_full(draw, 0, flags, shrink);
Tcl_ResetResult(interp);
}

View File

@ -5318,7 +5318,7 @@ proc no_open_dialogs {} {
set tctx::global_list {
PDK_ROOT PDK SKYWATER_MODELS SKYWATER_STDCELLS
INITIALINSTDIR INITIALLOADDIR INITIALPROPDIR INITIALTEXTDIR XSCHEM_LIBRARY_PATH
auto_hilight autofocus_mainwindow
add_all_windows_drives auto_hilight autofocus_mainwindow
autotrim_wires bespice_listen_port big_grid_points bus_replacement_char cadgrid cadlayers
cadsnap cairo_font_name change_lw color_ps colors compare_sch connect_by_kissing constrained_move
copy_cell custom_label_prefix custom_token dark_colors dark_colorscheme dim_bg dim_value
@ -5340,7 +5340,7 @@ set tctx::global_list {
textwindow_fileid textwindow_filename textwindow_w tmp_bus_char toolbar_horiz toolbar_list
toolbar_visible transparent_svg undo_type use_lab_wire use_label_prefix
user_wants_copy_cell verilog_2001 verilog_bitblast viewdata_fileid viewdata_filename viewdata_w
vsize xschem_libs xschem_listen_port add_all_windows_drives
vsize xschem_libs xschem_listen_port zoom_full_center
}
## list of global arrays to save/restore on context switching
@ -6400,6 +6400,7 @@ set_ne transparent_svg 0
set_ne only_probes 0 ; # 20110112
set_ne fullscreen 0
set_ne unzoom_nodrift 0
set_ne zoom_full_center 0
set_ne change_lw 1
set_ne line_width 0
set_ne live_cursor2_backannotate 0

View File

@ -150,6 +150,10 @@
#### default setting: 0
# set unzoom_nodrift 0
#### if set to 1 full zoom will center the drawing instead of anhoring to lower
#### left corner. Default: 0
# set zoom_full_center 1
#### if set to 1 allow to place multiple components with same name.
#### Warning: this is normally not allowed in any simulation netlist.
#### default: 0, do not allow place multiple elements with same name (refdes)