fix a bug in draw_graph_points() changing and not restoring linewidths if called with idx==-1

This commit is contained in:
Stefan Schippers 2023-10-13 18:46:15 +02:00
parent fb0b1c176a
commit c6a3880b9d
3 changed files with 4 additions and 2 deletions

View File

@ -1996,6 +1996,7 @@ static SPICE_DATA **get_bus_idx_array(const char *ntok, int *n_bits)
*/
static void set_thick_waves(int what, int wcnt, int wave_col, Graph_ctx *gr)
{
dbg(1, "set_thick_waves(): what=%d\n", what);
if(what) {
if(gr->hilight_wave == wcnt)
XSetLineAttributes (display, xctx->gc[wave_col],
@ -2248,11 +2249,11 @@ static void draw_graph_points(int idx, int first, int last,
gv = raw->values[idx];
dbg(1, "draw_graph_points: idx=%d, first=%d, last=%d, wcnt=%d\n", idx, first, last, wcnt);
if(idx == -1) return;
for(p=0;p<cadlayers; ++p) {
XSetLineAttributes(display, xctx->gc[p],
XLINEWIDTH(gr->linewidth_mult * xctx->lw), LineSolid, LINECAP , LINEJOIN);
}
if(idx == -1) return;
digital = gr->digital;
if(digital) {
s1 = DIG_NWAVES; /* 1/DIG_NWAVES waveforms fit in graph if unscaled vertically */

View File

@ -276,6 +276,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
tcleval("array unset ngspice::ngspice_data");
raw_read(f, &xctx->raw, "op");
if(xctx->raw && xctx->raw->values) {
tclsetvar("rawfile_loaded", "1");
xctx->raw->annot_p = 0;
for(i = 0; i < xctx->raw->nvars; ++i) {
char s[100];

View File

@ -1928,7 +1928,7 @@ void change_linewidth(double w)
int i, linew;
/* choose line width automatically based on zoom */
dbg(1, "change_linewidth(): w = %g, win_path=%s\n", w, xctx->current_win_path);
dbg(1, "change_linewidth(): w = %g, win_path=%s lw=%g\n", w, xctx->current_win_path, xctx->lw);
if(w<0. || xctx->lw == -1.0) {
double cs;
cs = tclgetdoublevar("cadsnap");