From 06e217d9990635be43a59233d75c504385d1e243 Mon Sep 17 00:00:00 2001 From: Tim Moore Date: Tue, 1 Dec 2009 13:34:12 +0100 Subject: [PATCH] Account for zoom factor when choosing hover text * grapher/Graph.cxx (getTimeAtPoint): Divide by _zoomFactor too. --- grapher/Graph.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/grapher/Graph.cxx b/grapher/Graph.cxx index 1d4787902..e7c03bd16 100644 --- a/grapher/Graph.cxx +++ b/grapher/Graph.cxx @@ -96,11 +96,11 @@ namespace systemtap cr->translate(0.0, _graphHeight); cr->scale(1.0, -1.0); GraphDataBase::TimeList::iterator lower - = std::lower_bound(graphData->times.begin(), graphData->times.end(), - _left); + = lower_bound(graphData->times.begin(), graphData->times.end(), + _left); GraphDataBase::TimeList::iterator upper - = std::upper_bound(graphData->times.begin(), graphData->times.end(), - _right); + = upper_bound(graphData->times.begin(), graphData->times.end(), + _right); // event bar if (graphData->style == GraphDataBase::EVENT) { @@ -265,6 +265,6 @@ namespace systemtap int64_t Graph::getTimeAtPoint(double x) { - return _left + (_right - _left) * ((x - 20.0)/_graphWidth); + return _left + (_right - _left) * ((x - 20.0)/(_zoomFactor * _graphWidth)); } } -- 2.43.5