Skip to content

Commit

Permalink
Fix crash for very short VCD Files (thx to timonix)
Browse files Browse the repository at this point in the history
  • Loading branch information
HendrikMennen committed Oct 7, 2024
1 parent f67066a commit faa0bff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/OneWare.WaveFormViewer/Controls/WaveFormScale.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public static List<Marker> CalculateMarkers(long beginOffset, long endOffset, in

var range = (double)(endOffset - beginOffset);
var mainStep = FindBeautifulStep(range, maxMainMarkers);
var intermediateStep = (long)(mainStep / 10);
var intermediateStep = (mainStep / 10);

var firstMainMarker = Math.Ceiling(beginOffset / mainStep) * mainStep;

Expand All @@ -76,7 +76,7 @@ public static List<Marker> CalculateMarkers(long beginOffset, long endOffset, in
var intermediateMarker = mainMarker + i * intermediateStep;
if (intermediateMarker < endOffset && intermediateMarker > beginOffset)
{
markers.Add(new Marker { Position = intermediateMarker, IsMainMarker = false });
markers.Add(new Marker { Position = (long)intermediateMarker, IsMainMarker = false });
}
}
}
Expand Down

0 comments on commit faa0bff

Please sign in to comment.