summaryrefslogtreecommitdiff
path: root/widgets/fastgraph.cpp
diff options
context:
space:
mode:
authorChristoph Berg <myon@debian.org>2026-06-22 12:03:44 +0200
committerChristoph Berg <myon@debian.org>2026-06-22 12:03:44 +0200
commitd83a420f0517d7fc47aeb288a6a0cf4891784fcc (patch)
tree6d9c83527c56458a8360ba080bf5f4ca73d526dc /widgets/fastgraph.cpp
parent4b089ae3f7e9e2d5662f718f663b26a4e8ee63ca (diff)
New upstream version 3.0.2+dfsgupstream/3.0.2+dfsg
Diffstat (limited to 'widgets/fastgraph.cpp')
-rw-r--r--widgets/fastgraph.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/widgets/fastgraph.cpp b/widgets/fastgraph.cpp
index 9efe5fc6..10580f82 100644
--- a/widgets/fastgraph.cpp
+++ b/widgets/fastgraph.cpp
@@ -98,7 +98,11 @@ void FastGraph::on_pbAutoLevel_clicked()
for(int i=0; i<=fast_jh; i++) {
sum += fast_green[i];
}
- m_ave=sum/fast_jh;
+ if (fast_jh == 0) {
+ m_ave=0.0;
+ } else {
+ m_ave=sum/fast_jh;
+ }
ui->gainSlider->setValue(127-int(2.2*m_ave));
ui->zeroSlider->setValue(int(m_ave)+20);
ui->greenZeroSlider->setValue(160-int(3.3*m_ave));