From e3b2b395b921e70449281ceb35f085ff5733a863 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Thu, 26 Jul 2018 20:55:21 +0200 Subject: [PATCH] fix an ancient bug in retrieving the data with the cursor from a log y graph: use y-offset instead of x-offset --- src/frontend/plotting/x11.c | 2 +- src/frontend/wdisp/windisp.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/frontend/plotting/x11.c b/src/frontend/plotting/x11.c index 6b03f8ec0..5f6720cb7 100644 --- a/src/frontend/plotting/x11.c +++ b/src/frontend/plotting/x11.c @@ -668,7 +668,7 @@ X_ScreentoData(GRAPH *graph, int x, int y, double *fx, double *fy) { lmin = log10(graph->datawindow.ymin); lmax = log10(graph->datawindow.ymax); - *fy = exp(((graph->absolute.height - y - graph->viewportxoff) + *fy = exp(((graph->absolute.height - y - graph->viewportyoff) * (lmax - lmin) / graph->viewport.height + lmin) * M_LN10); } else { diff --git a/src/frontend/wdisp/windisp.c b/src/frontend/wdisp/windisp.c index ed08fb571..63f6177e9 100644 --- a/src/frontend/wdisp/windisp.c +++ b/src/frontend/wdisp/windisp.c @@ -1017,7 +1017,7 @@ static void WIN_ScreentoData(GRAPH *graph, int x, int y, double *fx, double *fy) { lmin = log10(graph->datawindow.ymin); lmax = log10(graph->datawindow.ymax); - *fy = exp(((graph->absolute.height - y - graph->viewportxoff) * + *fy = exp(((graph->absolute.height - y - graph->viewportyoff) * (lmax - lmin) / graph->viewport.height + lmin) * M_LN10); } else { *fy = ((graph->absolute.height - y) - graph->viewportyoff) *