From 213300d799d0eff2c99b23b2da0cbeaaf24d2fcf Mon Sep 17 00:00:00 2001 From: Vadim Slyusarev Date: Fri, 12 Jul 2019 15:22:24 +0100 Subject: [PATCH] #75: Fixing a crash in GUI related to 0-width frames --- gui/Data/FrameCollection.cs | 3 ++- gui/ThreadView/ThreadRow.cs | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/gui/Data/FrameCollection.cs b/gui/Data/FrameCollection.cs index 60a8fca8..5149b7e5 100644 --- a/gui/Data/FrameCollection.cs +++ b/gui/Data/FrameCollection.cs @@ -525,7 +525,8 @@ public void Add(DataResponse response) if (group.Board.MainThreadIndex == frame.Header.ThreadIndex) { - Add(frame); + if (frame.Header.Duration > 0.0) + Add(frame); } break; diff --git a/gui/ThreadView/ThreadRow.cs b/gui/ThreadView/ThreadRow.cs index 98cc3f52..f15f5339 100644 --- a/gui/ThreadView/ThreadRow.cs +++ b/gui/ThreadView/ThreadRow.cs @@ -64,7 +64,9 @@ public class ThreadScroll public Durable ViewTime { get { return UnitToTime(ViewUnit); } } - public double Zoom { get { return 1.0 / ViewUnit.Width; } } + + const double MIN_WIDTH = 0.000001; + public double Zoom { get { return 1.0 / Math.Max(MIN_WIDTH, ViewUnit.Width); } } public double TimeToUnit(ITick tick) {