summaryrefslogtreecommitdiffstats
path: root/profile.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2012-11-01 11:44:18 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2012-11-01 11:44:18 -0700
commit01fd6a57bce4cd501b23481591462161f2ae34d5 (patch)
tree750c61be900dc490511a1f4690b4921fcffeef55 /profile.c
parentbdc6b6ba243678e00c3e7f639358ee803ef5d85b (diff)
downloadsubsurface-01fd6a57bce4cd501b23481591462161f2ae34d5.tar.gz
Add vertical space to depth plot if we are showing partial pressure graphs
Fairly simplistic change that modifies the way we calculate the "maxdepth" for a particular dive as that is used to scale the plot vertically. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'profile.c')
-rw-r--r--profile.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/profile.c b/profile.c
index 1e6d523f3..d32224190 100644
--- a/profile.c
+++ b/profile.c
@@ -220,16 +220,28 @@ static int get_maxtime(struct plot_info *pi)
}
}
+/* get the maximum depth to which we want to plot
+ * take into account the additional verical space needed to plot
+ * partial pressure graphs */
static int get_maxdepth(struct plot_info *pi)
{
unsigned mm = pi->maxdepth;
+ int md;
+
if (zoomed_plot) {
/* Rounded up to 10m, with at least 3m to spare */
- return ROUND_UP(mm+3000, 10000);
+ md = ROUND_UP(mm+3000, 10000);
} else {
/* Minimum 30m, rounded up to 10m, with at least 3m to spare */
- return MAX(30000, ROUND_UP(mm+3000, 10000));
+ md = MAX(30000, ROUND_UP(mm+3000, 10000));
+ }
+ if (GRAPHS_ENABLED) {
+ if (md <= 20000)
+ md += 10000;
+ else
+ md += ROUND_UP(md / 3, 10000);
}
+ return md;
}
typedef struct {