From 33dc14f9790c82669f48abe40662bee1314f5741 Mon Sep 17 00:00:00 2001 From: Tim Moore Date: Tue, 22 Dec 2009 15:06:17 +0100 Subject: grapher: fix bug in looking up event under pointer I don't why I thought this ever worked. * grapher/GraphStyle.cxx (GraphStyleEvent::dataIndexAtPoint): return distance from beginning of buffer, not beginning of search bounds. --- grapher/GraphStyle.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'grapher/GraphStyle.cxx') diff --git a/grapher/GraphStyle.cxx b/grapher/GraphStyle.cxx index 6bf4e109..5a6621bd 100644 --- a/grapher/GraphStyle.cxx +++ b/grapher/GraphStyle.cxx @@ -184,7 +184,7 @@ ssize_t GraphStyleEvent::dataIndexAtPoint(double x, double y, double xrect = (*ditr - left) * horizScale - 1.5 * graph->_lineWidth; if (xrect <= xgraph && xgraph < xrect + 3.0 * graph->_lineWidth && yrect <= ygraph && ygraph < yrect + 3.0 * graph->_lineWidth) - return static_cast(distance(lower, ditr)); + return static_cast(distance(graphData->times.begin(), ditr)); } return -1; } -- cgit