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>
This commit is contained in:
Maximilian Güntner 2013-09-25 02:47:47 +02:00
parent 88172571ca
commit a3ce871e0a

View file

@ -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)