]> sigrok.org Git - pulseview.git/commitdiff
Fix two small decode bugs
authorSoeren Apel <redacted>
Thu, 27 Feb 2020 08:31:46 +0000 (09:31 +0100)
committerUwe Hermann <redacted>
Mon, 16 Mar 2020 22:16:40 +0000 (23:16 +0100)
pv/data/decodesignal.cpp
pv/views/trace/decodetrace.cpp

index 8d606d43dd9b87c9b4ce5b9c7eda5426d4a4f61a..cd1d5ff301ea1d7d88f8498b6eb74a438211baa8 100644 (file)
@@ -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();
 
index d826587e507fbcbf03464cc8292700bf5b44ea3e..c451635fbd6c3b86830f1a7b6fa17e24981e988f 100644 (file)
@@ -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