X-Git-Url: http://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fview%2Fanalogsignal.cpp;fp=pv%2Fview%2Fanalogsignal.cpp;h=63e759f97ed7411922b70e2af4946dd2df643ad9;hp=8f6027b7a52f990135fc54cbe0881b93fc4d1c0a;hb=80067e4944e111bfa8d6b399812dddaa29d5a4ab;hpb=430b94aaa74cbbbf805803a013b77a4d1e18daaf diff --git a/pv/view/analogsignal.cpp b/pv/view/analogsignal.cpp index 8f6027b7..63e759f9 100644 --- a/pv/view/analogsignal.cpp +++ b/pv/view/analogsignal.cpp @@ -737,6 +737,13 @@ void AnalogSignal::on_pos_vdivs_changed(int vdivs) pos_vdivs_ = vdivs; + // There has to be at least one div, positive or negative + if ((neg_vdivs_ == 0) && (pos_vdivs_ == 0)) { + pos_vdivs_ = 1; + if (pvdiv_sb_) + pvdiv_sb_->setValue(pos_vdivs_); + } + if (autoranging_) { perform_autoranging(true, true); @@ -761,6 +768,13 @@ void AnalogSignal::on_neg_vdivs_changed(int vdivs) neg_vdivs_ = vdivs; + // There has to be at least one div, positive or negative + if ((neg_vdivs_ == 0) && (pos_vdivs_ == 0)) { + pos_vdivs_ = 1; + if (pvdiv_sb_) + pvdiv_sb_->setValue(pos_vdivs_); + } + if (autoranging_) { perform_autoranging(true, true);