]> git.tdb.fi Git - ext/subsurface.git/commitdiff
Don't draw temperature plot past the end of the dive
authorDirk Hohndel <dirk@hohndel.org>
Thu, 15 Sep 2011 16:09:25 +0000 (09:09 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 15 Sep 2011 16:33:13 +0000 (09:33 -0700)
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>
profile.c

index 66b4c835b52f17df9f7dc954d52455f9ed133b55..a4608c5185153ab2b36d8aa8349242c04cd69db6 100644 (file)
--- 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)