Skip to content

Commit 5e05417

Browse files
authored
fix: alignment graph plots offsets incorrectly (#23)
Fix plot offsets in the alignment graph for matches with mixed track orders by normalizing the track order.
1 parent 4f5430a commit 5e05417

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

AudioAlign/AlignmentGraphWindow.xaml.cs

+12
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,18 @@ private static void AddGraphLine(OxyPlot.PlotModel plotModel, MatchPair matchPai
5757
};
5858
matchPair
5959
.Matches
60+
.Select(m =>
61+
{
62+
// Create copies to avoid unexpected swapping in match list
63+
var copy = new Match(m);
64+
65+
if (copy.Track1 != matchPair.Track1)
66+
{
67+
copy.SwapTracks();
68+
}
69+
70+
return copy;
71+
})
6072
.OrderBy(match => match.Track1Time)
6173
.ToList()
6274
.ForEach(

0 commit comments

Comments
 (0)