set tk_scaling C variable global, updated in draw(), caching tcl tk_scaling variable, add tk_scaling in threshold expression in find_closest_*() functions
This commit is contained in:
parent
ee920560ff
commit
987faa1a41
|
|
@ -35,9 +35,7 @@ static int waves_selected(int event, KeySym key, int state, int button)
|
||||||
static unsigned int excl = STARTZOOM | STARTRECT | STARTLINE | STARTWIRE |
|
static unsigned int excl = STARTZOOM | STARTRECT | STARTLINE | STARTWIRE |
|
||||||
STARTPAN | STARTSELECT | STARTMOVE | STARTCOPY;
|
STARTPAN | STARTSELECT | STARTMOVE | STARTCOPY;
|
||||||
int draw_xhair = tclgetboolvar("draw_crosshair");
|
int draw_xhair = tclgetboolvar("draw_crosshair");
|
||||||
static double tk_scaling = 1.0;
|
|
||||||
int border;
|
int border;
|
||||||
tk_scaling = atof(tcleval("tk scaling"));
|
|
||||||
border = (int)(5.0 * tk_scaling); /* fixed number of screen pixels */
|
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 = state; /* rstate does not have ShiftMask bit, so easier to test for KeyPress events */
|
||||||
rstate &= ~ShiftMask; /* don't use ShiftMask, identifying characters is sufficient */
|
rstate &= ~ShiftMask; /* don't use ShiftMask, identifying characters is sufficient */
|
||||||
|
|
|
||||||
13
src/draw.c
13
src/draw.c
|
|
@ -3039,13 +3039,6 @@ static void draw_graph_grid(Graph_ctx *gr, void *ct)
|
||||||
int j, k;
|
int j, k;
|
||||||
double mark_size = gr->marginy/10.0;
|
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 */
|
/* calculate dash length for grid lines */
|
||||||
dash_size = 1.5 * xctx->mooz;
|
dash_size = 1.5 * xctx->mooz;
|
||||||
dash_size = dash_size < 1.0 ? 0.0: (dash_size > 3.0 ? 3.0 : 2.0);
|
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 */
|
/* graph bounding box */
|
||||||
drawrect(GRIDLAYER, NOW, gr->rx1, gr->ry1, gr->rx2, gr->ry2, 2, -1, -1);
|
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(START, 0.0, 0.0, 0.0, 0.0);
|
||||||
bbox(ADD, gr->rx1, gr->ry1, gr->rx2, gr->ry2);
|
bbox(ADD, gr->rx1, gr->ry1, gr->rx2, gr->ry2);
|
||||||
bbox(SET_INSIDE, 0.0, 0.0, 0.0, 0.0);
|
bbox(SET_INSIDE, 0.0, 0.0, 0.0, 0.0);
|
||||||
|
|
@ -5110,6 +5098,7 @@ void draw(void)
|
||||||
dbg(1, "draw()\n");
|
dbg(1, "draw()\n");
|
||||||
|
|
||||||
if(!xctx || xctx->no_draw) return;
|
if(!xctx || xctx->no_draw) return;
|
||||||
|
tk_scaling = atof(tcleval("tk scaling"));
|
||||||
cs = tclgetdoublevar("cadsnap");
|
cs = tclgetdoublevar("cadsnap");
|
||||||
cairo_font_scale = tclgetdoublevar("cairo_font_scale");
|
cairo_font_scale = tclgetdoublevar("cairo_font_scale");
|
||||||
xctx->cadhalfdotsize = CADHALFDOTSIZE * (cs < 20. ? cs : 20.) / 10.;
|
xctx->cadhalfdotsize = CADHALFDOTSIZE * (cs < 20. ? cs : 20.) / 10.;
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ static void find_closest_wire(double mx, double my, int override_lock)
|
||||||
int i, w=-1;
|
int i, w=-1;
|
||||||
double threshold;
|
double threshold;
|
||||||
double d = distance;
|
double d = distance;
|
||||||
threshold = CADWIREMINDIST * CADWIREMINDIST * xctx->zoom * xctx->zoom;
|
threshold = CADWIREMINDIST * CADWIREMINDIST * xctx->zoom * xctx->zoom * tk_scaling;
|
||||||
|
|
||||||
for(i=0;i<xctx->wires; ++i)
|
for(i=0;i<xctx->wires; ++i)
|
||||||
{
|
{
|
||||||
|
|
@ -117,7 +117,7 @@ static void find_closest_polygon(double mx, double my, int override_lock)
|
||||||
double x1, y1, x2, y2;
|
double x1, y1, x2, y2;
|
||||||
double threshold;
|
double threshold;
|
||||||
double d = distance;
|
double d = distance;
|
||||||
threshold = CADWIREMINDIST * CADWIREMINDIST * xctx->zoom * xctx->zoom;
|
threshold = CADWIREMINDIST * CADWIREMINDIST * xctx->zoom * xctx->zoom * tk_scaling;
|
||||||
for(c=0;c<cadlayers; ++c)
|
for(c=0;c<cadlayers; ++c)
|
||||||
{
|
{
|
||||||
if(!xctx->enable_layer[c]) continue;
|
if(!xctx->enable_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;
|
int i, c, l = -1, col = 0;
|
||||||
double threshold;
|
double threshold;
|
||||||
double d = distance;
|
double d = distance;
|
||||||
threshold = CADWIREMINDIST * CADWIREMINDIST * xctx->zoom * xctx->zoom;
|
threshold = CADWIREMINDIST * CADWIREMINDIST * xctx->zoom * xctx->zoom * tk_scaling;
|
||||||
for(c=0;c<cadlayers; ++c)
|
for(c=0;c<cadlayers; ++c)
|
||||||
{
|
{
|
||||||
if(!xctx->enable_layer[c]) continue;
|
if(!xctx->enable_layer[c]) continue;
|
||||||
|
|
@ -329,7 +329,7 @@ static void find_closest_arc(double mx, double my, int override_lock)
|
||||||
int match;
|
int match;
|
||||||
double threshold;
|
double threshold;
|
||||||
double d = distance;
|
double d = distance;
|
||||||
threshold = CADWIREMINDIST * CADWIREMINDIST * xctx->zoom * xctx->zoom;
|
threshold = CADWIREMINDIST * CADWIREMINDIST * xctx->zoom * xctx->zoom * tk_scaling;
|
||||||
|
|
||||||
for(c=0;c<cadlayers; ++c)
|
for(c=0;c<cadlayers; ++c)
|
||||||
{
|
{
|
||||||
|
|
@ -447,7 +447,7 @@ static void find_closest_text(double mx, double my, int override_lock)
|
||||||
#endif
|
#endif
|
||||||
char *estr = NULL;
|
char *estr = NULL;
|
||||||
double d = distance;
|
double d = distance;
|
||||||
threshold = CADWIREMINDIST * CADWIREMINDIST * xctx->zoom * xctx->zoom;
|
threshold = CADWIREMINDIST * CADWIREMINDIST * xctx->zoom * xctx->zoom * tk_scaling;
|
||||||
for(i=0;i<xctx->texts; ++i)
|
for(i=0;i<xctx->texts; ++i)
|
||||||
{
|
{
|
||||||
rot = xctx->text[i].rot;
|
rot = xctx->text[i].rot;
|
||||||
|
|
|
||||||
|
|
@ -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};
|
char bus_char[3] = {0, 0, 0};
|
||||||
int yyparse_error = 0;
|
int yyparse_error = 0;
|
||||||
char *xschem_executable=NULL;
|
char *xschem_executable=NULL;
|
||||||
|
double tk_scaling = 1.0;
|
||||||
Tcl_Interp *interp = NULL;
|
Tcl_Interp *interp = NULL;
|
||||||
double *character[256]; /* array or per-char coordinates of xschem internal vector font */
|
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() */
|
char old_win_path[PATH_MAX] = ".drw"; /* previously switched window, used in callback() */
|
||||||
|
|
|
||||||
|
|
@ -1228,6 +1228,7 @@ extern double cadhalfdotsize;
|
||||||
extern char bus_char[];
|
extern char bus_char[];
|
||||||
extern int yyparse_error;
|
extern int yyparse_error;
|
||||||
extern char *xschem_executable;
|
extern char *xschem_executable;
|
||||||
|
extern double tk_scaling;
|
||||||
extern Tcl_Interp *interp;
|
extern Tcl_Interp *interp;
|
||||||
extern double *character[256];
|
extern double *character[256];
|
||||||
extern char old_win_path[PATH_MAX]; /* previously switched window, used in callback() */
|
extern char old_win_path[PATH_MAX]; /* previously switched window, used in callback() */
|
||||||
|
|
|
||||||
|
|
@ -710,7 +710,7 @@
|
||||||
#### FIX GRAPHIC PROBLEMS ON SOME DRIVERS/GPU CONFIGURATIONS
|
#### FIX GRAPHIC PROBLEMS ON SOME DRIVERS/GPU CONFIGURATIONS
|
||||||
###########################################################################
|
###########################################################################
|
||||||
#### if you see garbage on screen / graphic artifacts while editing with
|
#### 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
|
# set fix_broken_tiled_fill 0
|
||||||
|
|
||||||
###########################################################################
|
###########################################################################
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue