diff options
author | Tim Moore <timoore@redhat.com> | 2009-08-04 23:46:02 +0200 |
---|---|---|
committer | Tim Moore <timoore@redhat.com> | 2009-09-30 20:25:36 +0200 |
commit | c18a296b760df73e2c233077aa0b863f67ed725f (patch) | |
tree | df0d6c9da9570f952e3b1c81681363a88990762e /grapher/GraphWidget.cxx | |
parent | bb91631807ad833a92d011895ad7ca1872e02745 (diff) | |
download | systemtap-steved-c18a296b760df73e2c233077aa0b863f67ed725f.tar.gz systemtap-steved-c18a296b760df73e2c233077aa0b863f67ed725f.tar.xz systemtap-steved-c18a296b760df73e2c233077aa0b863f67ed725f.zip |
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
Diffstat (limited to 'grapher/GraphWidget.cxx')
-rw-r--r-- | grapher/GraphWidget.cxx | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/grapher/GraphWidget.cxx b/grapher/GraphWidget.cxx index c4613fd7..757060e1 100644 --- a/grapher/GraphWidget.cxx +++ b/grapher/GraphWidget.cxx @@ -47,15 +47,15 @@ namespace systemtap void GraphWidget::addGraph() { - shared_ptr<Graph> 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> 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; } |