summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2014-04-28 22:47:56 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-04-28 14:15:08 -0700
commite5ce55ed6c19f26a55b8b3f189820c2c9c487023 (patch)
tree0aa66d30f4d18ac2f955619e85c89ac7b8859ef0
parent4f20bb9fb2731fdfd9faab3b109a0cbce8c89298 (diff)
downloadsubsurface-e5ce55ed6c19f26a55b8b3f189820c2c9c487023.tar.gz
Set minpressure from manually added cylinders
This includes minimum pressure from manually added cylinders to be taken into account on scaling. Without this, manually added cylinders might lead to pressure dropping below the Y axis 0 line (e.g. when first "computerized" cylinder is 220->140 and second, manually added cylinder, 200->50 bar). Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--profile.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/profile.c b/profile.c
index f5d287bfd..373ac8eb3 100644
--- a/profile.c
+++ b/profile.c
@@ -686,6 +686,8 @@ struct plot_info calculate_max_limits_new(struct dive *dive, struct divecomputer
unsigned int mbar = dive->cylinder[cyl].start.mbar;
if (mbar > maxpressure)
maxpressure = mbar;
+ if (mbar < minpressure)
+ minpressure = mbar;
}
/* Then do all the samples from all the dive computers */