From b49c878a74c7232994efba4bf56d309d8d224821 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Thu, 15 Sep 2011 09:09:25 -0700 Subject: [PATCH] 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 --- profile.c | 2 ++ 1 file changed, 2 insertions(+) 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) -- 2.45.2