summaryrefslogtreecommitdiffstats
path: root/profile.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-02-03 12:19:53 +1100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-02-03 12:47:32 +1100
commit4ddea283a5dfb2ebbb1d0e6a0d578107b4fd8e95 (patch)
tree4894c0f3f47de55b4eebbade7709a6a1752e1287 /profile.c
parent3e426283b48a2e6e51facd84a92680718420de58 (diff)
downloadsubsurface-4ddea283a5dfb2ebbb1d0e6a0d578107b4fd8e95.tar.gz
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 <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'profile.c')
-rw-r--r--profile.c3
1 files changed, 2 insertions, 1 deletions
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);
}
}