From: Dirk Hohndel Date: Thu, 15 Sep 2011 16:09:25 +0000 (-0700) Subject: Don't draw temperature plot past the end of the dive X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=b49c878a74c7232994efba4bf56d309d8d224821;p=ext%2Fsubsurface.git Don't draw temperature plot past the end of the dive Just like we end depth and tank pressure plots once we are on the surface (this is relevant for dive computers like the uemis Zurich that keep recording samples after the end of the dive) Signed-off-by: Dirk Hohndel Signed-off-by: Linus Torvalds --- diff --git a/profile.c b/profile.c index 66b4c83..a4608c5 100644 --- a/profile.c +++ b/profile.c @@ -372,6 +372,8 @@ static void plot_temperature_profile(struct dive *dive, struct graphics_context set_source_rgba(gc, 0.2, 0.2, 1.0, 0.8); for (i = 0; i < dive->samples; i++) { struct sample *sample = dive->sample+i; + if (sample->time.seconds > dive->duration.seconds) + break; /* let's not plot surface temp events */ int mkelvin = sample->temperature.mkelvin; if (!mkelvin) { if (!last)