]> sigrok.org Git - pulseview.git/blobdiff - pv/views/trace/decodetrace.cpp
Fix two small decode bugs
[pulseview.git] / pv / views / trace / decodetrace.cpp
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;
                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
                                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;
                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
                                r.anim_shape -= ArrowSize / (float)AnimationDurationInTicks;
                                animation_finished = false;
                        } else