aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Maximilian Güntner <maximilian.guentner@gmail.com>2013-09-25 02:47:47 +0200
committerGravatar Maximilian Güntner <maximilian.guentner@gmail.com>2013-09-27 18:45:07 +0200
commita3ce871e0ad8981964a189321ac70d021c8ac145 (patch)
treecce573f1b9e9220784e88db67ee2f9f0a4f54468
parent88172571ca3105fcccf6f7a23a0c60fb0f078e0e (diff)
downloadsubsurface-a3ce871e0ad8981964a189321ac70d021c8ac145.tar.gz
correct the placement of pressure markers
Adding +30 (seconds) to the position works fine for long dives but when zoomed in on short dives, 30 seconds are a lot. This commit sets the offset to +10 px regardless of the scaling. Signed-off-by: Maximilian Güntner <maximilian.guentner@gmail.com>
-rw-r--r--qt-ui/profilegraphics.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/qt-ui/profilegraphics.cpp b/qt-ui/profilegraphics.cpp
index f6550a7d8..17598a6af 100644
--- a/qt-ui/profilegraphics.cpp
+++ b/qt-ui/profilegraphics.cpp
@@ -414,6 +414,7 @@ void ProfileGraphicsView::plot_pp_text()
double pp, dpp, m;
int hpos;
static text_render_options_t tro = {PP_TEXT_SIZE, PP_LINES, LEFT, MIDDLE};
+ QGraphicsRectItem *pressureMarkers = new QGraphicsRectItem();
setup_pp_limits(&gc);
pp = floor(gc.pi.maxpp * 10.0) / 10.0 + 0.2;
@@ -427,8 +428,10 @@ void ProfileGraphicsView::plot_pp_text()
pen.setColor(c);
item->setPen(pen);
scene()->addItem(item);
- plot_text(&tro, QPointF(hpos + 30, m), QString::number(m));
+ plot_text(&tro, QPointF(hpos, m), QString::number(m), pressureMarkers);
}
+ scene()->addItem(pressureMarkers);
+ pressureMarkers->setPos(pressureMarkers->pos().x() + 10, 0);
}
void ProfileGraphicsView::plot_add_line(int sec, double val, QColor c, QPointF &from)