summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--grapher/Graph.cxx2
-rw-r--r--grapher/GraphWidget.cxx10
2 files changed, 9 insertions, 3 deletions
diff --git a/grapher/Graph.cxx b/grapher/Graph.cxx
index 7f9b2607..496b85b1 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 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;
}