diff --git a/src/callback.c b/src/callback.c index c2f6be0c..b2882780 100644 --- a/src/callback.c +++ b/src/callback.c @@ -27,13 +27,13 @@ static int waves_selected() int is_inside = 0; xRect *r; rebuild_selected_array(); - if(xctx->ui_state != SELECTION || !xctx->lastsel) return 0; + if(!(xctx->ui_state & SELECTION) || !xctx->lastsel) return 0; for(i=0; ilastsel; i++) { c = xctx->sel_array[i].col; if(xctx->sel_array[i].type == xRECT && c == 2) { n = xctx->sel_array[i].n; r = &xctx->rect[c][n]; - if( POINTINSIDE(xctx->mousex, xctx->mousey, r->x1, r->y1, r->x2, r->y2) ) { + if( (xctx->ui_state & GRAPHPAN) || POINTINSIDE(xctx->mousex, xctx->mousey, r->x1, r->y1, r->x2, r->y2) ) { is_inside = 1; } if(r->flags != 1) return 0; @@ -491,9 +491,10 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int } else if( ((state & ShiftMask) && event == ButtonPress && (button == Button1)) || ((state & ShiftMask) && event == MotionNotify && (state & Button1Mask)) ) { - if(bottom) { + if(bottom || (xctx->ui_state & GRAPHPAN)) { double wwx1, wwx2, p, delta, ccx, ddx; + xctx->ui_state |= GRAPHPAN; delta = wx2 - wx1; wwx1 = 0; /* <<<< */ wwx2 = get_raw_value(dataset, 0, xctx->npoints[dataset] - 1); @@ -514,6 +515,9 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int xctx->mx_double_save = xctx->mousex_snap; xctx->my_double_save = xctx->mousey_snap; } + else if(event == ButtonRelease && (xctx->ui_state & GRAPHPAN) ) { + xctx->ui_state &= ~GRAPHPAN; + } else if(!(state & ShiftMask) && event == ButtonRelease && button == Button3) { double tmp; xx1 = G_X(xctx->mx_double_save); diff --git a/src/xschem.h b/src/xschem.h index c9b17806..9caae970 100644 --- a/src/xschem.h +++ b/src/xschem.h @@ -201,6 +201,7 @@ extern char win_temp_dir[PATH_MAX]; #define MENUSTARTCIRCLE 2097152 #define PLACE_SYMBOL 4194304 /* used in move_objects after place_symbol to avoid storing intermediate undo state */ #define START_SYMPIN 8388608 +#define GRAPHPAN 16777216 #define SELECTED 1 /* used in the .sel field for selected objs. */ #define SELECTED1 2 /* first point selected... */ #define SELECTED2 4 /* second point selected... */