From: Soeren Apel Date: Thu, 27 Feb 2020 08:31:46 +0000 (+0100) Subject: Fix two small decode bugs X-Git-Url: http://sigrok.org/gitweb/?p=pulseview.git;a=commitdiff_plain;h=8b24af15d583c1df24b49f9709ff9156a9faa16e Fix two small decode bugs --- diff --git a/pv/data/decodesignal.cpp b/pv/data/decodesignal.cpp index 8d606d43..cd1d5ff3 100644 --- a/pv/data/decodesignal.cpp +++ b/pv/data/decodesignal.cpp @@ -141,6 +141,8 @@ bool DecodeSignal::toggle_decoder_visibility(int index) void DecodeSignal::reset_decode(bool shutting_down) { + resume_decode(); // Make sure the decode thread isn't blocked by pausing + if (stack_config_changed_ || shutting_down) stop_srd_session(); else @@ -158,8 +160,6 @@ void DecodeSignal::reset_decode(bool shutting_down) logic_mux_thread_.join(); } - resume_decode(); // Make sure the decode thread isn't blocked by pausing - current_segment_id_ = 0; segments_.clear(); diff --git a/pv/views/trace/decodetrace.cpp b/pv/views/trace/decodetrace.cpp index d826587e..c451635f 100644 --- a/pv/views/trace/decodetrace.cpp +++ b/pv/views/trace/decodetrace.cpp @@ -1834,7 +1834,7 @@ void DecodeTrace::on_animation_timer() if (r.expanding) { if (r.height < r.expanded_height) { r.anim_height += height_delta / (float)AnimationDurationInTicks; - r.height = r.anim_height; + r.height = min((int)r.anim_height, (int)r.expanded_height); r.anim_shape += ArrowSize / (float)AnimationDurationInTicks; animation_finished = false; } else @@ -1844,7 +1844,7 @@ void DecodeTrace::on_animation_timer() if (r.collapsing) { if (r.height > default_row_height_) { r.anim_height -= height_delta / (float)AnimationDurationInTicks; - r.height = r.anim_height; + r.height = max((int)r.anim_height, (int)0); r.anim_shape -= ArrowSize / (float)AnimationDurationInTicks; animation_finished = false; } else