]> sourceware.org Git - systemtap.git/commitdiff
more multiple graph fixes
authorTim Moore <timoore@redhat.com>
Tue, 4 Aug 2009 21:46:02 +0000 (23:46 +0200)
committerTim Moore <timoore@redhat.com>
Wed, 30 Sep 2009 18:25:36 +0000 (20:25 +0200)
* 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

grapher/Graph.cxx
grapher/GraphWidget.cxx

index 7f9b26072064adb6d4c3845fe8afa5bb0c7b72d0..496b85b123a5f9a32d8d9eb260185254b3177db1 100644 (file)
@@ -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;
   }
   
   
index c4613fd728bdae7e1bfc53da1c2da79f47230712..757060e1f6ed6f471cc65f80b364970b51bc9f9d 100644 (file)
@@ -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;
   }
This page took 0.032305 seconds and 5 git commands to generate.