fix some race conditions (xevents) when doing a png export from cmdline options; fix svg light colorscheme background (was always black)

This commit is contained in:
Stefan Schippers 2020-08-30 23:58:51 +02:00
parent 858eac08fa
commit 7ce7654748
3 changed files with 9 additions and 10 deletions

View File

@ -50,15 +50,14 @@ void print_image()
if(!has_x) return ;
ww = xschem_w;
hh = xschem_h;
my_snprintf(cmd, S(cmd), "input_line {Enter image size} {} {%dx%d}", xschem_w, xschem_h);
tcleval(cmd);
if(sscanf(tclresult(), "%dx%d", &w, &h) != 2) {
w = xschem_w; h = xschem_h;
}
w = ww = xschem_w;
h = hh = xschem_h;
if(!plotfile[0]) {
my_snprintf(cmd, S(cmd), "input_line {Enter image size} {} {%dx%d}", xschem_w, xschem_h);
tcleval(cmd);
if(sscanf(tclresult(), "%dx%d", &w, &h) != 2) {
w = xschem_w; h = xschem_h;
}
my_strdup(60, &tmpstring, "tk_getSaveFile -title {Select destination file} -initialdir $env(PWD)");
tcleval(tmpstring);
r = tclresult();

View File

@ -481,7 +481,7 @@ void svg_draw(void)
}
fprintf(fd, "</style>\n");
if(color_ps) {
if(dark_colorscheme) {
/* black background */
fprintf(fd,"<rect x=\"%g\" y=\"%g\" width=\"%g\" height=\"%g\" fill=\"rgb(%d,%d,%d)\" stroke=\"rgb(%d,%d,%d)\" stroke-width=\"%g\" />\n",
0.0, 0.0, dx, dy, 0, 0, 0,

View File

@ -1407,7 +1407,7 @@ int Tcl_AppInit(Tcl_Interp *inter)
tcleval( "exit");
}
if(do_print==1) ps_draw();
else if(do_print == 2) print_image();
else if(do_print == 2) { tcleval("tkwait visibility .drw"); print_image(); }
else svg_draw();
}