X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fview%2Fview.cpp;h=12c277d5434582a5e4b63ada3b85e4324154ff46;hp=f146470d314f72443c9b90063f20e42da9575abd;hb=8a463dbc1da0a229a726c1d0f278d361d871cfe1;hpb=8a1bc0876c9d9e25719e416466a3bb983c705968 diff --git a/pv/view/view.cpp b/pv/view/view.cpp index f146470d..12c277d5 100644 --- a/pv/view/view.cpp +++ b/pv/view/view.cpp @@ -84,7 +84,7 @@ namespace pv { namespace view { const double View::MaxScale = 1e9; -const double View::MinScale = 1e-15; +const double View::MinScale = 1e-12; const int View::MaxScrollValue = INT_MAX / 2; const int View::MaxViewAutoUpdateRate = 25; // No more than 25 Hz with sticky scrolling @@ -494,7 +494,7 @@ void View::set_zoom(double scale, int offset) void View::calculate_tick_spacing() { const double SpacingIncrement = 10.0f; - const double MinValueSpacing = 25.0f; + const double MinValueSpacing = 40.0f; // Figure out the highest numeric value visible on a label const QSize areaSize = viewport_->size(); @@ -925,14 +925,20 @@ void View::signals_changed() void View::capture_state_updated(int state) { - // Reset "always zoom to fit" when we change to the stopped state - if (always_zoom_to_fit_ && (state == Session::Stopped)) { - always_zoom_to_fit_ = false; - always_zoom_to_fit_changed(false); - } - if (state == Session::Running) time_unit_ = util::Samples; + + if (state == Session::Stopped) { + // After acquisition has stopped we need to re-calculate the ticks once + // as it's otherwise done when the user pans or zooms, which is too late + calculate_tick_spacing(); + + // Reset "always zoom to fit", the acquisition has stopped + if (always_zoom_to_fit_) { + always_zoom_to_fit_ = false; + always_zoom_to_fit_changed(false); + } + } } void View::data_updated()