waves_callback(): do not set GRAPHPAN when setting cursor position numerically

This commit is contained in:
stefan schippers 2024-01-05 11:21:34 +01:00
parent 1fa490b066
commit dcef3d4b9d
2 changed files with 9 additions and 6 deletions

View File

@ -427,7 +427,7 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
} else {
tclvareval("input_line {Pos:} {xschem set cursor1_x} ", dtoa_eng(xctx->graph_cursor1_x), NULL);
}
event = 0; /* avoid further processing ButtonPress that might set GRAPHPAH */
redraw_all_at_end = 1;
}
if( (xctx->graph_flags & 4) && fabs(xctx->mousex - W_X(xctx->graph_cursor2_x)) < 10) {
@ -441,6 +441,7 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
} else {
tclvareval("input_line {Pos:} {xschem set cursor2_x} ", dtoa_eng(xctx->graph_cursor2_x), NULL);
}
event = 0; /* avoid further processing ButtonPress that might set GRAPHPAH */
redraw_all_at_end = 1;
}
}
@ -539,7 +540,6 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
!xctx->graph_top /* && !xctx->graph_bottom */
) {
xctx->ui_state |= GRAPHPAN;
dbg(1, "save mouse\n");
if(!xctx->graph_left) xctx->mx_double_save = xctx->mousex_snap;
if(xctx->graph_left) xctx->my_double_save = xctx->mousey_snap;
}
@ -1004,7 +1004,7 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
}
}
} /* if( event == KeyPress || event == ButtonPress || event == MotionNotify ) */
else if( event == ButtonRelease) {
else if( event == ButtonRelease) {
if(button != Button3) {
xctx->ui_state &= ~GRAPHPAN;
xctx->graph_flags &= ~(16 | 32); /* clear move cursor flags */
@ -1029,6 +1029,8 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "x1", dtoa(xx1)));
my_strdup(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "x2", dtoa(xx2)));
need_redraw = 1;
} else if(i == xctx->graph_master) {
clear_graphpan_at_end = 1;
}
}
}

View File

@ -53,7 +53,7 @@ y2=180
ypos1=0
ypos2=2
subdivy=1
unity=1
x1=3
x2=10
@ -64,13 +64,14 @@ node="\\"ph diffout @ 1uA; ph(diffout)%0\\"
\\"ph diffout @ 100uA; ph(diffout)%2\\""
color="6 4 7"
unitx=M
unitx=1
divx=10
divy=5
logx=1
rawfile=$netlist_dir/test_ac.raw
sim_type=ac}
sim_type=ac
subdivy=4}
B 2 1430 -620 1567 -560 {flags=image
alpha=0.6
filter="gm convert png:- -transparent black png:-"