From 72195f6b17c0ed2e508c58bf3cadd5b9dc4e28ac Mon Sep 17 00:00:00 2001 From: Tim Moore Date: Tue, 22 Dec 2009 23:30:56 +0100 Subject: grapher: remove _zoomFactor from horizontal scaling calculation This makes zooming more consistent and less buggy. * grapher/Graph.cxx (Graph::draw): Set graph time spread using _zoomFactor. * grapher/Graph.hxx (Graph::getHorizontalScale): no _zoomFactor * grapher/GraphWidget.cxx (on_motion_notify_event): Dragging increment uses _zoomFactor. (on_scroll_event): Set extents after changing the zoom factor with the scroll wheel. --- grapher/Graph.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'grapher/Graph.cxx') diff --git a/grapher/Graph.cxx b/grapher/Graph.cxx index 4d697ae6..079cd63e 100644 --- a/grapher/Graph.cxx +++ b/grapher/Graph.cxx @@ -44,7 +44,7 @@ void Graph::draw(Cairo::RefPtr cr) // Find latest time. _right = _currentTime / 1000; // Assume 1 pixel = 5 milliseconds - _left = _right - 5000; + _left = _right - static_cast(5000 / _zoomFactor); } cr->save(); double horizScale = getHorizontalScale(); -- cgit