Author: aschnell Date: Thu Jan 15 19:12:22 2009 New Revision: 54670 URL: http://svn.opensuse.org/viewcvs/yast?rev=54670&view=rev Log: - backup Modified: branches/tmp/aschnell/graph/qt-graph/src/YQGraph.cc branches/tmp/aschnell/graph/qt-graph/src/YQGraph.h Modified: branches/tmp/aschnell/graph/qt-graph/src/YQGraph.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/graph/qt-graph/src/YQGraph.cc?rev=54670&r1=54669&r2=54670&view=diff ============================================================================== --- branches/tmp/aschnell/graph/qt-graph/src/YQGraph.cc (original) +++ branches/tmp/aschnell/graph/qt-graph/src/YQGraph.cc Thu Jan 15 19:12:22 2009 @@ -120,11 +120,11 @@ } -// transform graphviz point into Qt QPointF QPointF YQGraph::gToQ(const point& p) const { - return QPointF(p.x, p.y); + QPointF tmp(p.x, p.y); + return QPointF(tmp.x(), size.height() - tmp.y()); } @@ -219,10 +219,12 @@ void YQGraph::renderGraph(graph_t* graph) { - const int border = 20; - QRectF size(gToQ(GD_bb(graph).LL), gToQ(GD_bb(graph).UR)); - size.adjust(-border, -border, border, border); - scene->setSceneRect(size); + // don't use gToQ here since it adjusts the values + QRectF rect(GD_bb(graph).LL.x, GD_bb(graph).LL.y, GD_bb(graph).UR.x, GD_bb(graph).UR.y); + const qreal border = 20.0; + scene->setSceneRect(rect.adjusted(-border, -border, border, border)); + + size = rect.size(); QPen pen1("red"); Modified: branches/tmp/aschnell/graph/qt-graph/src/YQGraph.h URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/graph/qt-graph/src/YQGraph.h?rev=54670&r1=54669&r2=54670&view=diff ============================================================================== --- branches/tmp/aschnell/graph/qt-graph/src/YQGraph.h (original) +++ branches/tmp/aschnell/graph/qt-graph/src/YQGraph.h Thu Jan 15 19:12:22 2009 @@ -78,12 +78,17 @@ void wheelEvent(QWheelEvent* event); void scaleView(qreal scaleFactor); + /** + * Transform graphviz point into Qt QPointF. + */ QPointF gToQ(const point& p) const; private: QGraphicsScene* scene; + QSizeF size; + void arrow(QPainterPath& path, const QLineF& line, const QString& type); }; -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org