From 937261807bba5c43540a66ea9fd3faed82bb0d2f Mon Sep 17 00:00:00 2001 From: Stefan Frederik Date: Wed, 17 Nov 2021 01:30:37 +0100 Subject: [PATCH] fix setting snap and grid values in statusbar --- src/actions.c | 2 +- src/callback.c | 2 +- src/xschem.tcl | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/actions.c b/src/actions.c index db068449..c97c28b5 100644 --- a/src/actions.c +++ b/src/actions.c @@ -112,7 +112,7 @@ void print_version() void set_snap(double newsnap) /* 20161212 set new snap factor and just notify new value */ { static double default_snap = -1.0; - int cs; + double cs; cs = tclgetdoublevar("cadsnap"); if(default_snap == -1.0) { diff --git a/src/callback.c b/src/callback.c index 399df991..bb73e776 100644 --- a/src/callback.c +++ b/src/callback.c @@ -145,7 +145,7 @@ int callback(const char *winpath, int event, int mx, int my, KeySym key, struct stat buf; int redraw_only; unsigned short sel; - int c_snap; + double c_snap; #ifndef __unix__ short cstate = GetKeyState(VK_CAPITAL); short nstate = GetKeyState(VK_NUMLOCK); diff --git a/src/xschem.tcl b/src/xschem.tcl index d9adc5f9..18bd89a1 100644 --- a/src/xschem.tcl +++ b/src/xschem.tcl @@ -3710,8 +3710,8 @@ proc pack_widgets { { topwin {} } } { pack $topwin.menubar -anchor n -side top -fill x -before $topwin.drw toolbar_show $topwin pack $topwin.statusbar -after $topwin.drw -anchor sw -fill x - bind $topwin.statusbar.5 {xschem set cadgrid $cadgrid} - bind $topwin.statusbar.3 {xschem set cadsnap $cadsnap} + bind $topwin.statusbar.5 "set cadgrid \[$topwin.statusbar.5 get\]; xschem set cadgrid \$cadgrid" + bind $topwin.statusbar.3 "set cadsnap \[$topwin.statusbar.3 get\]; xschem set cadsnap \$cadsnap" set_bindings $topwin.drw } }