diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2013-05-31 05:28:24 +0900 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-05-31 05:28:24 +0900 |
commit | 32d8051404498cdba8b43c49d1b2aba5fb97818c (patch) | |
tree | 12563a5ddc7e1854d4be1a2242821596fc0a5321 /qt-ui/profilegraphics.cpp | |
parent | 344a429e4811c60b9b12ef225c2b5b8d31d8534b (diff) | |
download | subsurface-32d8051404498cdba8b43c49d1b2aba5fb97818c.tar.gz |
Cleanup minor issues with ceilings for individualy tissues
In commit b8d31d8534b ("Show ceilings for individual tissues") Robert
inadvertently broke the connection from dc_ceilings to red_ceilings and
also didn't correctly enable the checkbox for all_tissues when
calc_ceilings was already set in the preferences before the dialog was
created (and therefore the connection in the .ui file isn't run).
There's also a simplification / cleanup to the code deciding whether to
show all the tissues.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profilegraphics.cpp')
-rw-r--r-- | qt-ui/profilegraphics.cpp | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/qt-ui/profilegraphics.cpp b/qt-ui/profilegraphics.cpp index d635e1956..fb336da72 100644 --- a/qt-ui/profilegraphics.cpp +++ b/qt-ui/profilegraphics.cpp @@ -1074,28 +1074,26 @@ void ProfileGraphicsView::plot_depth_profile() } /* plot the calculated ceiling for all tissues */ - if (prefs.calc_all_tissues){ + if (prefs.profile_calc_ceiling && prefs.calc_all_tissues){ int k; for (k=0; k<16; k++){ - if (prefs.profile_calc_ceiling) { - pat.setColorAt(0, profile_color[CALC_CEILING_SHALLOW].first()); - pat.setColorAt(1, QColor(100, 100, 100, 50)); - - entry = gc.pi.entry; - p.clear(); - p.append(QPointF(SCALEGC(0, 0))); - for (i = 0; i < gc.pi.nr; i++, entry++) { - if ((entry->ceilings)[k]) - p.append(QPointF(SCALEGC(entry->sec, (entry->ceilings)[k]))); - else - p.append(QPointF(SCALEGC(entry->sec, 0))); - } - p.append(QPointF(SCALEGC((entry-1)->sec, 0))); - neatFill = new QGraphicsPolygonItem(); - neatFill->setPolygon(p); - neatFill->setBrush(pat); - scene()->addItem(neatFill); + pat.setColorAt(0, profile_color[CALC_CEILING_SHALLOW].first()); + pat.setColorAt(1, QColor(100, 100, 100, 50)); + + entry = gc.pi.entry; + p.clear(); + p.append(QPointF(SCALEGC(0, 0))); + for (i = 0; i < gc.pi.nr; i++, entry++) { + if ((entry->ceilings)[k]) + p.append(QPointF(SCALEGC(entry->sec, (entry->ceilings)[k]))); + else + p.append(QPointF(SCALEGC(entry->sec, 0))); } + p.append(QPointF(SCALEGC((entry-1)->sec, 0))); + neatFill = new QGraphicsPolygonItem(); + neatFill->setPolygon(p); + neatFill->setBrush(pat); + scene()->addItem(neatFill); } } /* next show where we have been bad and crossed the dc's ceiling */ |