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>
This commit is contained in:
Dirk Hohndel 2012-12-07 11:36:25 -08:00
parent 982abb5596
commit a0f28aa422
3 changed files with 42 additions and 4 deletions

View file

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