diff options
-rw-r--r-- | grapher/Graph.cxx | 6 | ||||
-rw-r--r-- | grapher/Graph.hxx | 2 | ||||
-rw-r--r-- | grapher/GraphWidget.cxx | 4 |
3 files changed, 8 insertions, 4 deletions
diff --git a/grapher/Graph.cxx b/grapher/Graph.cxx index ec5e4035..e1ea01f6 100644 --- a/grapher/Graph.cxx +++ b/grapher/Graph.cxx @@ -9,11 +9,13 @@ namespace systemtap using namespace std; using namespace std::tr1; - Graph::Graph() - : _lineWidth(2), _autoScaling(true), _autoScrolling(true), + Graph::Graph(double x, double y) + : _graphX(0), _graphY(0), + _lineWidth(2), _autoScaling(true), _autoScrolling(true), _zoomFactor(1.0), _playButton(new CairoPlayButton), _left(0.0), _right(1.0), _top(5.0), _bottom(0.0) { + setOrigin(x, y); } diff --git a/grapher/Graph.hxx b/grapher/Graph.hxx index 1cc1892d..aad63767 100644 --- a/grapher/Graph.hxx +++ b/grapher/Graph.hxx @@ -12,7 +12,7 @@ namespace systemtap { public: friend class GraphWidget; - Graph(); + Graph(double x = 0.0, double y = 0.0); virtual void draw(Cairo::RefPtr<Cairo::Context> cr); virtual bool containsPoint(double x, double y); double getLineWidth() { return _lineWidth; } diff --git a/grapher/GraphWidget.cxx b/grapher/GraphWidget.cxx index 4a1e0918..53c7645d 100644 --- a/grapher/GraphWidget.cxx +++ b/grapher/GraphWidget.cxx @@ -70,8 +70,10 @@ namespace systemtap cr->paint(); for (GraphList::iterator g = _graphs.begin(); g != _graphs.end(); ++g) { + double x, y; + (*g)->getOrigin(x, y); cr->save(); - cr->translate((*g)->_graphX, (*g)->_graphY); + cr->translate(x, y); (*g)->draw(cr); cr->restore(); } |