From a0f28aa42271ef014a91c4b8c83d871d7ae0cdf5 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 7 Dec 2012 11:36:25 -0800 Subject: 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 Signed-off-by: Dirk Hohndel --- profile.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'profile.c') 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); -- cgit v1.2.3-70-g09d2