diff options
Diffstat (limited to 'grapher/Models/Calculations/AccelChartData.cs')
| -rw-r--r-- | grapher/Models/Calculations/AccelChartData.cs | 4 |
1 files changed, 3 insertions, 1 deletions
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; } |