mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-07 23:26:16 +00:00
Avoid divide by 0 error
Avoid crash when moving mouse to left side of the plot when showing mean depth Signed-off-by: Krzysztof Arentowicz <k.arentowicz@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
26c3dcbcb6
commit
ee1ef52330
1 changed files with 1 additions and 1 deletions
|
@ -943,7 +943,7 @@ void InstantMeanDepthLine::mouseMoved(int time, int depth)
|
||||||
int count = model->data().nr;
|
int count = model->data().nr;
|
||||||
for(int i = 0; i < count; i++){
|
for(int i = 0; i < count; i++){
|
||||||
struct plot_data pI = model->data().entry[i];
|
struct plot_data pI = model->data().entry[i];
|
||||||
if (pI.sec == time) {
|
if (pI.sec == time && pI.sec != 0) {
|
||||||
setMeanDepth(pI.running_sum / time);
|
setMeanDepth(pI.running_sum / time);
|
||||||
setLine(0, 0, hAxis->posAtValue(time), 0);
|
setLine(0, 0, hAxis->posAtValue(time), 0);
|
||||||
setPos(pos().x(), vAxis->posAtValue(pI.running_sum / time));
|
setPos(pos().x(), vAxis->posAtValue(pI.running_sum / time));
|
||||||
|
|
Loading…
Add table
Reference in a new issue