mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
profile: don't add excessive depth
The old get_maxdepth() function in profile.c was accounting for two things: - the partial pressure graphs - rounding to sane value Both are now taken care of by the profile itself. This leads to excessive max-depths. Remove the code from profile.c. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
de71435c11
commit
725fda3cd1
2 changed files with 5 additions and 18 deletions
|
@ -75,23 +75,12 @@ int get_maxtime(const struct plot_info *pi)
|
||||||
return MAX(min, seconds);
|
return MAX(min, seconds);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get the maximum depth to which we want to plot
|
/* get the maximum depth to which we want to plot */
|
||||||
* take into account the additional vertical space needed to plot
|
|
||||||
* partial pressure graphs */
|
|
||||||
int get_maxdepth(const struct plot_info *pi)
|
int get_maxdepth(const struct plot_info *pi)
|
||||||
{
|
{
|
||||||
unsigned mm = pi->maxdepth;
|
/* 3m to spare */
|
||||||
int md;
|
int mm = pi->maxdepth + 3000;
|
||||||
|
return prefs.zoomed_plot ? mm : MAX(30000, mm);
|
||||||
if (prefs.zoomed_plot) {
|
|
||||||
/* Rounded up to 10m, with at least 3m to spare */
|
|
||||||
md = ROUND_UP(mm + 3000, 10000);
|
|
||||||
} else {
|
|
||||||
/* Minimum 30m, rounded up to 10m, with at least 3m to spare */
|
|
||||||
md = MAX((unsigned)30000, ROUND_UP(mm + 3000, 10000));
|
|
||||||
}
|
|
||||||
md += lrint(pi->maxpp * 9000);
|
|
||||||
return md;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* UNUSED! */
|
/* UNUSED! */
|
||||||
|
|
|
@ -95,9 +95,7 @@ extern void free_plot_info_data(struct plot_info *pi);
|
||||||
*/
|
*/
|
||||||
extern int get_maxtime(const struct plot_info *pi);
|
extern int get_maxtime(const struct plot_info *pi);
|
||||||
|
|
||||||
/* get the maximum depth to which we want to plot
|
/* get the maximum depth to which we want to plot */
|
||||||
* take into account the additional verical space needed to plot
|
|
||||||
* partial pressure graphs */
|
|
||||||
extern int get_maxdepth(const struct plot_info *pi);
|
extern int get_maxdepth(const struct plot_info *pi);
|
||||||
|
|
||||||
static inline int get_plot_pressure_data(const struct plot_info *pi, int idx, enum plot_pressure sensor, int cylinder)
|
static inline int get_plot_pressure_data(const struct plot_info *pi, int idx, enum plot_pressure sensor, int cylinder)
|
||||||
|
|
Loading…
Reference in a new issue