Browse Source

fix an ancient bug in retrieving the data with the cursor

from a log y graph: use y-offset instead of x-offset
pre-master-46
Holger Vogt 8 years ago
parent
commit
e3b2b395b9
  1. 2
      src/frontend/plotting/x11.c
  2. 2
      src/frontend/wdisp/windisp.c

2
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 {

2
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) *

Loading…
Cancel
Save