From ba642cd8c8e63ec3778fa17ecbcd7964074aaba1 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Mon, 21 Sep 2020 00:08:19 -0700 Subject: separate x/y mostly works --- grapher/Models/Calculations/AccelChartData.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'grapher/Models/Calculations/AccelChartData.cs') diff --git a/grapher/Models/Calculations/AccelChartData.cs b/grapher/Models/Calculations/AccelChartData.cs index c943643..907eb0e 100644 --- a/grapher/Models/Calculations/AccelChartData.cs +++ b/grapher/Models/Calculations/AccelChartData.cs @@ -63,7 +63,7 @@ namespace grapher.Models.Calculations public (double, double, double) ValuesAtIndex(int index) { - return (VelocityPoints.ElementAt(index).Value, AccelPoints.ElementAt(index).Value, GainPoints.ElementAt(index).Value); + return (AccelPoints.ElementAt(index).Value, VelocityPoints.ElementAt(index).Value, GainPoints.ElementAt(index).Value); } public int GetVelocityIndex(double outVelocityValue) @@ -75,6 +75,8 @@ namespace grapher.Models.Calculations velIdx = ~velIdx; } + velIdx = Math.Min(velIdx, VelocityPoints.Count - 1); + return velIdx; } -- cgit v1.2.3