mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 23:23:23 +00:00
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:
parent
88172571ca
commit
a3ce871e0a
1 changed files with 4 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue