aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-01-31 14:55:37 +1100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-01-31 14:55:37 +1100
commitc8f2622f2ff8f4e7b3f50bd318c466bb458d8932 (patch)
tree9dabdcb99b2f7317c2af44549f55a0c102a06d1d
parent36b34bd5a5abdfabbd0f3ab0bb0d33e6e3477dd9 (diff)
downloadsubsurface-c8f2622f2ff8f4e7b3f50bd318c466bb458d8932.tar.gz
Fix the tooltips
Commit a52b0aa5ea8d ("Show Gradient Factors in plot when showing calculated ceilings") incorrectly modified the gc which caused the mouse position no longer correctly being correlated to the time on the plot. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--profile.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/profile.c b/profile.c
index bb55f5b15..130b32407 100644
--- a/profile.c
+++ b/profile.c
@@ -1127,12 +1127,10 @@ static void plot_cylinder_pressure_text(struct graphics_context *gc, struct plot
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;
text_render_options_t tro = {10, PRESSURE_TEXT, CENTER, -0.2};
- gc->leftx = 0;
- gc->rightx = gc->maxtime = 1.0;
- gc->topy = 0;
- gc->bottomy = 1.0;
- plot_text(gc, &tro, 0.5, 0, "GF %.0f/%.0f", prefs.gflow * 100, prefs.gfhigh * 100);
+ plot_text(gc, &tro, x, y, "GF %.0f/%.0f", prefs.gflow * 100, prefs.gfhigh * 100);
}
}