summaryrefslogtreecommitdiff
path: root/grapher/Models/Calculations/AccelChartData.cs
diff options
context:
space:
mode:
authorJacob Palecki <[email protected]>2020-09-22 02:28:35 -0700
committerJacob Palecki <[email protected]>2020-09-22 02:28:35 -0700
commit8e58892723ee10792c7d3db275da826f98d01677 (patch)
tree25d5c35fba0734f891737aa038e882f318296353 /grapher/Models/Calculations/AccelChartData.cs
parentMerge remote-tracking branch 'upstream/Experiment' into GUI (diff)
downloadrawaccel-8e58892723ee10792c7d3db275da826f98d01677.tar.xz
rawaccel-8e58892723ee10792c7d3db275da826f98d01677.zip
Mostly works
Diffstat (limited to 'grapher/Models/Calculations/AccelChartData.cs')
-rw-r--r--grapher/Models/Calculations/AccelChartData.cs2
1 files changed, 1 insertions, 1 deletions
diff --git a/grapher/Models/Calculations/AccelChartData.cs b/grapher/Models/Calculations/AccelChartData.cs
index fbf1944..5225e08 100644
--- a/grapher/Models/Calculations/AccelChartData.cs
+++ b/grapher/Models/Calculations/AccelChartData.cs
@@ -54,7 +54,6 @@ namespace grapher.Models.Calculations
{
var velIdx = GetVelocityIndex(outVelocityValue);
- velIdx = Math.Min(velIdx, VelocityPoints.Count - 1);
values = (VelocityPoints.ElementAt(velIdx).Key, AccelPoints.ElementAt(velIdx).Value, GainPoints.ElementAt(velIdx).Value);
OutVelocityToPoints.Add(outVelocityValue, values);
return values;
@@ -81,6 +80,7 @@ namespace grapher.Models.Calculations
}
velIdx = Math.Min(velIdx, VelocityPoints.Count - 1);
+ velIdx = Math.Max(velIdx, 0);
return velIdx;
}