From a3ce871e0ad8981964a189321ac70d021c8ac145 Mon Sep 17 00:00:00 2001 From: Maximilian Güntner Date: Wed, 25 Sep 2013 02:47:47 +0200 Subject: correct the placement of pressure markers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- qt-ui/profilegraphics.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'qt-ui/profilegraphics.cpp') 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) -- cgit v1.2.3-70-g09d2