From: Tim Moore Date: Tue, 4 Aug 2009 21:46:02 +0000 (+0200) Subject: more multiple graph fixes X-Git-Tag: release-1.0.9~152 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=c18a296b760df73e2c233077aa0b863f67ed725f;p=systemtap.git more multiple graph fixes * grapher/Graph.cxx (Graph constructor): set _drawX, _drawY * grapher/GraphWidget.cxx (addGraph): Fix graph layout (on_button_press_event): Fix test of play button in multiple graphs --- diff --git a/grapher/Graph.cxx b/grapher/Graph.cxx index 7f9b26072..496b85b12 100644 --- a/grapher/Graph.cxx +++ b/grapher/Graph.cxx @@ -17,6 +17,8 @@ namespace systemtap _left(0.0), _right(1.0), _top(5.0), _bottom(0.0) { setOrigin(x, y); + _graphX = x; + _graphY = y; } diff --git a/grapher/GraphWidget.cxx b/grapher/GraphWidget.cxx index c4613fd72..757060e1f 100644 --- a/grapher/GraphWidget.cxx +++ b/grapher/GraphWidget.cxx @@ -47,15 +47,15 @@ namespace systemtap void GraphWidget::addGraph() { - shared_ptr graph(new Graph); double x = 0.0; double y = 0.0; if (!_graphs.empty()) { _graphs.back()->getOrigin(x, y); y += _graphs.back()->_height + 10; - _height = y + graph->_height; } + shared_ptr graph(new Graph(x, y)); + _height = y + graph->_height; graph->setOrigin(x, y); _graphs.push_back(graph); queue_resize(); @@ -109,8 +109,11 @@ namespace systemtap } if (!_activeGraph) return true; + double activeX, activeY; + _activeGraph->getOrigin(activeX, activeY); if (!_activeGraph->_autoScrolling - && _activeGraph->_playButton->containsPoint(event->x, event->y)) + && _activeGraph->_playButton->containsPoint(event->x - activeX, + event->y - activeY)) { _activeGraph->_autoScaling = true; _activeGraph->_autoScrolling = true; @@ -131,6 +134,7 @@ namespace systemtap bool GraphWidget::on_button_release_event(GdkEventButton* event) { + _activeGraph.reset(); _trackingDrag = false; return true; }