From aa493783aceeea606248cd7238e2f0af0cb7417c Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Mon, 8 Sep 2025 09:54:57 +0200 Subject: [PATCH] better inner border selection area for graphs, easier to right click on signal names --- src/callback.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/callback.c b/src/callback.c index 1cc7c6f2..23cb0e1c 100644 --- a/src/callback.c +++ b/src/callback.c @@ -35,6 +35,10 @@ static int waves_selected(int event, KeySym key, int state, int button) static unsigned int excl = STARTZOOM | STARTRECT | STARTLINE | STARTWIRE | STARTPAN | STARTSELECT | STARTMOVE | STARTCOPY; int draw_xhair = tclgetboolvar("draw_crosshair"); + 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 */ 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; @@ -64,12 +68,12 @@ static int waves_selected(int event, KeySym key, int state, int button) (xctx->ui_state & GRAPHPAN) || (event != -3 && ( - POINTINSIDE(xctx->mousex, xctx->mousey, r->x1 + 5, r->y1 + 5, r->x2 - 5, r->y2 - 5) + POINTINSIDE(xctx->mousex, xctx->mousey, r->x1 + border, r->y1 + border, r->x2 - border, r->y2 - border) ) ) || (event == -3 && /* double click */ ( - POINTINSIDE(xctx->mousex, xctx->mousey, r->x1 + 5, r->y1 + 5, r->x2 - 5, r->y2 - 5) + POINTINSIDE(xctx->mousex, xctx->mousey, r->x1 + border, r->y1 + border, r->x2 - border, r->y2 - border) ) );