From 4ddea283a5dfb2ebbb1d0e6a0d578107b4fd8e95 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sun, 3 Feb 2013 12:19:53 +1100 Subject: Imitialize gc y range for GF factor print It seemed so smart to just base the coordinates on what's already in the graphics context. Except that we apparently got a 0 to 0 range for y coordinates if there are no pressure samples for a dive. This fixes the problem and GF values are shown even for dives without pressure samples. Reported-by: Miika Turkia Signed-off-by: Dirk Hohndel --- profile.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/profile.c b/profile.c index 03abf40e6..123f25479 100644 --- a/profile.c +++ b/profile.c @@ -1137,8 +1137,9 @@ static void plot_deco_text(struct graphics_context *gc, struct plot_info *pi) { if (prefs.profile_calc_ceiling) { float x = gc->leftx + (gc->rightx - gc->leftx) / 2; - float y = gc->topy; + float y = gc->topy = 1.0; text_render_options_t tro = {10, PRESSURE_TEXT, CENTER, -0.2}; + gc->bottomy = 0.0; plot_text(gc, &tro, x, y, "GF %.0f/%.0f", prefs.gflow * 100, prefs.gfhigh * 100); } } -- cgit v1.2.3-70-g09d2