From: Soeren Apel Date: Mon, 6 Mar 2017 18:07:36 +0000 (+0100) Subject: TraceView: Fix "always zoom to fit" feature X-Git-Tag: pulseview-0.4.0~166 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=3906e758503d37794b12e92aee68757e54a89a38;p=pulseview.git TraceView: Fix "always zoom to fit" feature --- diff --git a/pv/view/view.cpp b/pv/view/view.cpp index 04bb9920..23de2087 100644 --- a/pv/view/view.cpp +++ b/pv/view/view.cpp @@ -1251,6 +1251,8 @@ void View::capture_state_updated(int state) // Reset "always zoom to fit", the acquisition has stopped if (always_zoom_to_fit_) { + // Perform a final zoom-to-fit before disabling + zoom_fit(always_zoom_to_fit_); always_zoom_to_fit_ = false; always_zoom_to_fit_changed(always_zoom_to_fit_); } @@ -1272,10 +1274,9 @@ void View::data_updated() void View::perform_delayed_view_update() { - if (always_zoom_to_fit_) + if (always_zoom_to_fit_) { zoom_fit(true); - - if (sticky_scrolling_) { + } else if (sticky_scrolling_) { // Make right side of the view sticky double length = 0; Timestamp offset;