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>
This commit is contained in:
Dirk Hohndel 2013-02-03 12:19:53 +11:00
parent 3e426283b4
commit 4ddea283a5

View file

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