aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-05-08 16:53:00 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-05-08 16:53:00 -0700
commitd120fed21191f547db1b2bc3a04a9ce389faec0f (patch)
tree9981090da09e38bfede653bb1fccee85ebcd9c69
parent880870b46cce3b964d1ef3e472ec3c94544b5c25 (diff)
downloadsubsurface-d120fed21191f547db1b2bc3a04a9ce389faec0f.tar.gz
Add bounding box to profile
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-ui/profilegraphics.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/qt-ui/profilegraphics.cpp b/qt-ui/profilegraphics.cpp
index 46e040132..50791e14c 100644
--- a/qt-ui/profilegraphics.cpp
+++ b/qt-ui/profilegraphics.cpp
@@ -248,9 +248,13 @@ void ProfileGraphicsView::plot(struct dive *dive)
plot_cylinder_pressure_text(gc, pi);
plot_deco_text(gc, pi);
#endif
-
- gc.leftx = 0; gc.rightx = 1.0;
- gc.topy = 0; gc.bottomy = 1.0;
+ /* Bounding box */
+ QColor color = profile_color[TIME_GRID].at(0);
+ QPen pen = QPen(color);
+ pen.setWidth(1);
+ QGraphicsRectItem *rect = new QGraphicsRectItem(scene()->sceneRect());
+ rect->setPen(pen);
+ scene()->addItem(rect);
/* Put the dive computer name in the lower left corner */
const char *nickname;
@@ -259,7 +263,7 @@ void ProfileGraphicsView::plot(struct dive *dive)
nickname = dc->model;
if (nickname) {
text_render_options_t computer = {DC_TEXT_SIZE, TIME_TEXT, LEFT, MIDDLE};
- plot_text(&computer, 0, 1, nickname);
+ plot_text(&computer, gc.leftx, gc.bottomy, nickname);
}
#if 0
if (PP_GRAPHS_ENABLED) {