summaryrefslogtreecommitdiffstats
path: root/profile.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2012-12-07 11:36:25 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2012-12-07 11:39:15 -0800
commita0f28aa42271ef014a91c4b8c83d871d7ae0cdf5 (patch)
tree9139dc72ae3f93a004428b9a5085434335400c45 /profile.c
parent982abb5596d6c92004c8ea88320878540f5a8415 (diff)
downloadsubsurface-a0f28aa42271ef014a91c4b8c83d871d7ae0cdf5.tar.gz
Add option to make ceiling visually stand out more in the profile
While having the background "come down" seemed like a good visualization of the ceiling, some divers appear to prefer something more dramatic. This adds an option to the Tec Settings to have the ceiling shown in red instead of the default background color. Suggested-by: Jan Schubert <Jan.Schubert@GMX.li> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'profile.c')
-rw-r--r--profile.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/profile.c b/profile.c
index cea974b21..8940817b8 100644
--- a/profile.c
+++ b/profile.c
@@ -1007,6 +1007,31 @@ static void plot_depth_profile(struct graphics_context *gc, struct plot_info *pi
cairo_close_path(gc->cr);
cairo_fill(gc->cr);
+ /* if the user wants the deco ceiling more visible, do that here (this
+ * basically draws over the background that we had allowed to shine
+ * through so far) */
+ if (profile_red_ceiling) {
+ pat = cairo_pattern_create_linear (0.0, 0.0, 0.0, 256.0 * plot_scale);
+ pattern_add_color_stop_rgba (gc, pat, 0, CEILING_SHALLOW);
+ pattern_add_color_stop_rgba (gc, pat, 1, CEILING_DEEP);
+ cairo_set_source(gc->cr, pat);
+ cairo_pattern_destroy(pat);
+ entry = pi->entry;
+ move_to(gc, 0, 0);
+ for (i = 0; i < pi->nr; i++, entry++) {
+ if (entry->ndl == 0 && entry->stopdepth) {
+ if (entry->ndl == 0 && entry->stopdepth < entry->depth) {
+ line_to(gc, entry->sec, entry->stopdepth);
+ } else {
+ line_to(gc, entry->sec, entry->depth);
+ }
+ } else {
+ line_to(gc, entry->sec, 0);
+ }
+ }
+ cairo_close_path(gc->cr);
+ cairo_fill(gc->cr);
+ }
/* next show where we have been bad and crossed the ceiling */
pat = cairo_pattern_create_linear (0.0, 0.0, 0.0, 256.0 * plot_scale);
pattern_add_color_stop_rgba (gc, pat, 0, CEILING_SHALLOW);