diff --git a/src/callback.c b/src/callback.c index 23cb0e1c..8c13012a 100644 --- a/src/callback.c +++ b/src/callback.c @@ -38,7 +38,7 @@ static int waves_selected(int event, KeySym key, int state, int button) static double tk_scaling = 1.0; int border; tk_scaling = atof(tcleval("tk scaling")); - border = (int)(5.0 * tk_scaling * xctx->zoom); /* fixed number of screen pixels */ + border = (int)(5.0 * tk_scaling); /* fixed number of screen pixels */ rstate = state; /* rstate does not have ShiftMask bit, so easier to test for KeyPress events */ rstate &= ~ShiftMask; /* don't use ShiftMask, identifying characters is sufficient */ if(xctx->ui_state & excl) skip = 1; @@ -66,6 +66,11 @@ static int waves_selected(int event, KeySym key, int state, int button) check = (xctx->ui_state & GRAPHPAN) || + ((event == ButtonPress || event == ButtonRelease) && button == Button3 && + ( + POINTINSIDE(xctx->mousex, xctx->mousey, r->x1, r->y1, r->x2, r->y2) + ) + ) || (event != -3 && ( POINTINSIDE(xctx->mousex, xctx->mousey, r->x1 + border, r->y1 + border, r->x2 - border, r->y2 - border) diff --git a/src/draw.c b/src/draw.c index d49bc7a1..8bfb323e 100644 --- a/src/draw.c +++ b/src/draw.c @@ -3039,6 +3039,13 @@ static void draw_graph_grid(Graph_ctx *gr, void *ct) int j, k; double mark_size = gr->marginy/10.0; + #if 0 + static double tk_scaling = 1.0; + int border; + tk_scaling = atof(tcleval("tk scaling")); + border = (int)(5.0 * tk_scaling); /* fixed number of screen pixels */ + #endif + /* calculate dash length for grid lines */ dash_size = 1.5 * xctx->mooz; dash_size = dash_size < 1.0 ? 0.0: (dash_size > 3.0 ? 3.0 : 2.0); @@ -3049,6 +3056,11 @@ static void draw_graph_grid(Graph_ctx *gr, void *ct) /* graph bounding box */ drawrect(GRIDLAYER, NOW, gr->rx1, gr->ry1, gr->rx2, gr->ry2, 2, -1, -1); + #if 0 + /* graph graph selection boundary */ + drawrect(GRIDLAYER, NOW, gr->rx1+border, gr->ry1+border, gr->rx2-border, gr->ry2-border, 2, -1, -1); + #endif + bbox(START, 0.0, 0.0, 0.0, 0.0); bbox(ADD, gr->rx1, gr->ry1, gr->rx2, gr->ry2); bbox(SET_INSIDE, 0.0, 0.0, 0.0, 0.0);