mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-27 20:58:47 +00:00
profile: fix tankbar
The logic has just been completely broken when implementing zooming. Fixes #3376 Reported-by: Anton Lundin glance@acc.umu.se Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
b56eacbaec
commit
ab830fcfd7
1 changed files with 3 additions and 4 deletions
|
@ -89,19 +89,18 @@ void TankItem::setData(const struct dive *d, int plotStartTime, int plotEndTime)
|
|||
|
||||
// skip over all gas changes before the plotted range
|
||||
const struct event *ev = get_next_event(dc->events, "gaschange");
|
||||
while (ev && (int)ev->time.seconds <= plotStartTime)
|
||||
while (ev && (int)ev->time.seconds <= plotStartTime) {
|
||||
gasmix = get_gasmix_from_event(d, ev);
|
||||
ev = get_next_event(ev->next, "gaschange");
|
||||
}
|
||||
|
||||
// work through all the gas changes and add the rectangle for each gas while it was used
|
||||
int startTime = plotStartTime;
|
||||
while (ev && (int)ev->time.seconds < plotEndTime) {
|
||||
gasmix = get_gasmix_from_event(d, ev);
|
||||
createBar(startTime, ev->time.seconds, gasmix);
|
||||
startTime = ev->time.seconds;
|
||||
gasmix = get_gasmix_from_event(d, ev);
|
||||
ev = get_next_event(ev->next, "gaschange");
|
||||
}
|
||||
if (ev)
|
||||
gasmix = get_gasmix_from_event(d, ev);
|
||||
createBar(startTime, plotEndTime, gasmix);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue