diff --git a/src/callback.c b/src/callback.c index 6f02f6c9..0266d7a3 100644 --- a/src/callback.c +++ b/src/callback.c @@ -35,9 +35,7 @@ static int waves_selected(int event, KeySym key, int state, int button) static unsigned int excl = STARTZOOM | STARTRECT | STARTLINE | STARTWIRE | STARTPAN | STARTSELECT | STARTMOVE | STARTCOPY; int draw_xhair = tclgetboolvar("draw_crosshair"); - static double tk_scaling = 1.0; int border; - tk_scaling = atof(tcleval("tk scaling")); border = (int)(5.0 * tk_scaling); /* fixed number of screen pixels */ rstate = state; /* rstate does not have ShiftMask bit, so easier to test for KeyPress events */ rstate &= ~ShiftMask; /* don't use ShiftMask, identifying characters is sufficient */ diff --git a/src/draw.c b/src/draw.c index 8bfb323e..22bd8a78 100644 --- a/src/draw.c +++ b/src/draw.c @@ -3039,13 +3039,6 @@ static void draw_graph_grid(Graph_ctx *gr, void *ct) int j, k; double mark_size = gr->marginy/10.0; - #if 0 - static double tk_scaling = 1.0; - int border; - tk_scaling = atof(tcleval("tk scaling")); - border = (int)(5.0 * tk_scaling); /* fixed number of screen pixels */ - #endif - /* calculate dash length for grid lines */ dash_size = 1.5 * xctx->mooz; dash_size = dash_size < 1.0 ? 0.0: (dash_size > 3.0 ? 3.0 : 2.0); @@ -3056,11 +3049,6 @@ static void draw_graph_grid(Graph_ctx *gr, void *ct) /* graph bounding box */ drawrect(GRIDLAYER, NOW, gr->rx1, gr->ry1, gr->rx2, gr->ry2, 2, -1, -1); - #if 0 - /* graph graph selection boundary */ - drawrect(GRIDLAYER, NOW, gr->rx1+border, gr->ry1+border, gr->rx2-border, gr->ry2-border, 2, -1, -1); - #endif - bbox(START, 0.0, 0.0, 0.0, 0.0); bbox(ADD, gr->rx1, gr->ry1, gr->rx2, gr->ry2); bbox(SET_INSIDE, 0.0, 0.0, 0.0, 0.0); @@ -5110,6 +5098,7 @@ void draw(void) dbg(1, "draw()\n"); if(!xctx || xctx->no_draw) return; + tk_scaling = atof(tcleval("tk scaling")); cs = tclgetdoublevar("cadsnap"); cairo_font_scale = tclgetdoublevar("cairo_font_scale"); xctx->cadhalfdotsize = CADHALFDOTSIZE * (cs < 20. ? cs : 20.) / 10.; diff --git a/src/findnet.c b/src/findnet.c index 5a4688c4..3a19ef2a 100644 --- a/src/findnet.c +++ b/src/findnet.c @@ -33,7 +33,7 @@ static void find_closest_wire(double mx, double my, int override_lock) int i, w=-1; double threshold; double d = distance; - threshold = CADWIREMINDIST * CADWIREMINDIST * xctx->zoom * xctx->zoom; + threshold = CADWIREMINDIST * CADWIREMINDIST * xctx->zoom * xctx->zoom * tk_scaling; for(i=0;iwires; ++i) { @@ -117,7 +117,7 @@ static void find_closest_polygon(double mx, double my, int override_lock) double x1, y1, x2, y2; double threshold; double d = distance; - threshold = CADWIREMINDIST * CADWIREMINDIST * xctx->zoom * xctx->zoom; + threshold = CADWIREMINDIST * CADWIREMINDIST * xctx->zoom * xctx->zoom * tk_scaling; for(c=0;cenable_layer[c]) continue; @@ -162,7 +162,7 @@ static void find_closest_line(double mx, double my, int override_lock) int i, c, l = -1, col = 0; double threshold; double d = distance; - threshold = CADWIREMINDIST * CADWIREMINDIST * xctx->zoom * xctx->zoom; + threshold = CADWIREMINDIST * CADWIREMINDIST * xctx->zoom * xctx->zoom * tk_scaling; for(c=0;cenable_layer[c]) continue; @@ -329,7 +329,7 @@ static void find_closest_arc(double mx, double my, int override_lock) int match; double threshold; double d = distance; - threshold = CADWIREMINDIST * CADWIREMINDIST * xctx->zoom * xctx->zoom; + threshold = CADWIREMINDIST * CADWIREMINDIST * xctx->zoom * xctx->zoom * tk_scaling; for(c=0;czoom * xctx->zoom; + threshold = CADWIREMINDIST * CADWIREMINDIST * xctx->zoom * xctx->zoom * tk_scaling; for(i=0;itexts; ++i) { rot = xctx->text[i].rot; diff --git a/src/globals.c b/src/globals.c index 7a270d4d..69bc92b2 100644 --- a/src/globals.c +++ b/src/globals.c @@ -184,6 +184,7 @@ int text_ps=1; /* use ps font for text instead of xschem's internal vector font char bus_char[3] = {0, 0, 0}; int yyparse_error = 0; char *xschem_executable=NULL; +double tk_scaling = 1.0; Tcl_Interp *interp = NULL; double *character[256]; /* array or per-char coordinates of xschem internal vector font */ char old_win_path[PATH_MAX] = ".drw"; /* previously switched window, used in callback() */ diff --git a/src/xschem.h b/src/xschem.h index 1da329d8..e0ed0d41 100644 --- a/src/xschem.h +++ b/src/xschem.h @@ -1228,6 +1228,7 @@ extern double cadhalfdotsize; extern char bus_char[]; extern int yyparse_error; extern char *xschem_executable; +extern double tk_scaling; extern Tcl_Interp *interp; extern double *character[256]; extern char old_win_path[PATH_MAX]; /* previously switched window, used in callback() */ diff --git a/src/xschemrc b/src/xschemrc index 86705ef2..d928cdb0 100644 --- a/src/xschemrc +++ b/src/xschemrc @@ -710,7 +710,7 @@ #### FIX GRAPHIC PROBLEMS ON SOME DRIVERS/GPU CONFIGURATIONS ########################################################################### #### if you see garbage on screen / graphic artifacts while editing with -#### xschem try to set this to 1. Default: not enabled (0) +#### xschem try to set this to 1. Default: enabled (1) # set fix_broken_tiled_fill 0 ###########################################################################