profile: don't plot event-icons outside of range

Do this by extending the isInteresting() function for
dive event items.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2021-10-09 15:05:27 +02:00 committed by Dirk Hohndel
parent a496ab016b
commit 1a429d9b17
3 changed files with 11 additions and 3 deletions

View file

@ -191,8 +191,15 @@ static int depthAtTime(const plot_info &pi, duration_t time)
}
bool DiveEventItem::isInteresting(const struct dive *d, const struct divecomputer *dc,
const struct event *ev, const plot_info &pi)
const struct event *ev, const plot_info &pi,
int firstSecond, int lastSecond)
{
/*
* Ignore items outside of plot range
*/
if (ev->time.seconds < firstSecond || ev->time.seconds >= lastSecond)
return false;
/*
* Some gas change events are special. Some dive computers just tell us the initial gas this way.
* Don't bother showing those