improve cursor display and move with multiple graphs with different sweep variables
This commit is contained in:
parent
fdeca4646a
commit
ba76f42277
|
|
@ -429,11 +429,11 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
|
|||
int idx;
|
||||
double cursorx;
|
||||
idx = get_raw_index(find_nth(get_tok_value(r->prop_ptr, "sweep", 0), ", ", "\"", 0, 1), NULL);
|
||||
if(idx < 0) idx = 0;
|
||||
cursorx = xctx->graph_cursor1_x;
|
||||
if(idx) {
|
||||
if(idx >= 0 ) {
|
||||
cursorx = xctx->raw->cursor_a_val[idx];
|
||||
}
|
||||
if(idx < 0) idx = 0;
|
||||
/* dragging cursors when mouse is very close */
|
||||
if( fabs(xctx->mousex - W_X(cursorx)) < 10) {
|
||||
xctx->graph_flags |= 16; /* Start move cursor1 */
|
||||
|
|
@ -443,11 +443,11 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
|
|||
int idx;
|
||||
double cursorx;
|
||||
idx = get_raw_index(find_nth(get_tok_value(r->prop_ptr, "sweep", 0), ", ", "\"", 0, 1), NULL);
|
||||
if(idx < 0) idx = 0;
|
||||
cursorx = xctx->graph_cursor2_x;
|
||||
if(idx) {
|
||||
if(idx >= 0) {
|
||||
cursorx = xctx->raw->cursor_b_val[idx];
|
||||
}
|
||||
if(idx < 0) idx = 0;
|
||||
/* dragging cursors when mouse is very close */
|
||||
if(fabs(xctx->mousex - W_X(cursorx)) < 10) {
|
||||
xctx->graph_flags |= 32; /* Start move cursor2 */
|
||||
|
|
|
|||
|
|
@ -2920,8 +2920,7 @@ static void draw_cursor(int active_cursor, int cursor_color, int i, Graph_ctx *g
|
|||
other_cursorx = xctx->graph_cursor1_x;
|
||||
}
|
||||
idx = get_raw_index(find_nth(get_tok_value(r->prop_ptr, "sweep", 0), ", ", "\"", 0, 1), NULL);
|
||||
if(idx < 0) idx = 0;
|
||||
if(idx) {
|
||||
if(idx >= 0) {
|
||||
dbg(1, "draw_cursor(): idx=%d, cursor=%g\n", idx, xctx->raw->cursor_a_val[idx]);
|
||||
if(active_cursor == 1) {
|
||||
active_cursorx = xctx->raw->cursor_a_val[idx];
|
||||
|
|
@ -2931,6 +2930,7 @@ static void draw_cursor(int active_cursor, int cursor_color, int i, Graph_ctx *g
|
|||
other_cursorx = xctx->raw->cursor_a_val[idx];
|
||||
}
|
||||
}
|
||||
if(idx < 0) idx = 0;
|
||||
xx = W_X(active_cursorx);
|
||||
flip = (other_cursorx > active_cursorx) ? 0 : 1;
|
||||
xoffs = flip ? 3 : -3;
|
||||
|
|
|
|||
Loading…
Reference in New Issue