diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2013-12-04 13:27:34 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-12-04 13:27:34 -0800 |
commit | 5fc50b2aaba122bf0c7b4251565800aec7a1e4a1 (patch) | |
tree | eea5d74e3db44328b7033695a87d0327182526fb /qt-ui | |
parent | 66716b5297cd1657fd8c5a9f9fea373a1b64531c (diff) | |
download | subsurface-5fc50b2aaba122bf0c7b4251565800aec7a1e4a1.tar.gz |
Improve labeling for partial pressure graphs
This backs off a little on what was added in commit c1102a38f359 ("More
gradient on the partial pressure graph.") - the numbers simply got too
busy. I also slightly changed the positioning of the numbers to be a
little more "natural looking".
Fixes #323
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/profilegraphics.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/qt-ui/profilegraphics.cpp b/qt-ui/profilegraphics.cpp index 93ab1e1ab..00eb9edbe 100644 --- a/qt-ui/profilegraphics.cpp +++ b/qt-ui/profilegraphics.cpp @@ -540,16 +540,16 @@ void ProfileGraphicsView::plot_pp_text() { double pp, dpp, m; int hpos; - static text_render_options_t tro = {PP_TEXT_SIZE, PP_LINES, LEFT, MIDDLE}; + static text_render_options_t tro = {PP_TEXT_SIZE, PP_LINES, LEFT, -0.75}; QGraphicsRectItem *pressureMarkers = new QGraphicsRectItem(); setup_pp_limits(&gc); pp = floor(gc.pi.maxpp * 10.0) / 10.0 + 0.2; - dpp = pp > 4 ? 0.5 : 0.2; + dpp = pp > 4 ? 0.5 : 0.25; hpos = gc.pi.entry[gc.pi.nr - 1].sec; QColor c = getColor(PP_LINES); - bool alt = false; + bool alt = true; for (m = 0.0; m <= pp; m += dpp) { QGraphicsLineItem *item = new QGraphicsLineItem(SCALEGC(0, m), SCALEGC(hpos, m)); QPen pen(defaultPen); @@ -562,9 +562,8 @@ void ProfileGraphicsView::plot_pp_text() scene()->addItem(item); qreal textPos = hpos; if (alt) - textPos += 30; + plot_text(&tro, QPointF(textPos, m), QString::number(m), pressureMarkers); alt = !alt; - plot_text(&tro, QPointF(textPos, m), QString::number(m), pressureMarkers); } scene()->addItem(pressureMarkers); pressureMarkers->setPos(pressureMarkers->pos().x() + 10, 0); |