summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2011-09-15 09:09:25 -0700
committerGravatar Linus Torvalds <torvalds@linux-foundation.org>2011-09-15 09:33:13 -0700
commitb49c878a74c7232994efba4bf56d309d8d224821 (patch)
tree3c80586c7d40b39ef17b5e92fe0718bf314060f2
parented4e71a817e370f397d5f4b7dc613f01b5564456 (diff)
downloadsubsurface-b49c878a74c7232994efba4bf56d309d8d224821.tar.gz
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 <dirk@hohndel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--profile.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/profile.c b/profile.c
index 66b4c835b..a4608c518 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)