Fixed a bug with Keyframes that only have a single coordinate, to correctly return that Y value for any requested X position.

This commit is contained in:
Jonathan Thomas
2012-10-04 14:13:13 -05:00
parent 2266a4ab7a
commit 268e776251

View File

@@ -231,7 +231,12 @@ void Keyframe::Process() {
// fill in all values between 0 and 1st point's co.X
Point p1 = Points[0];
for (int x = 0; x < p1.co.X; x++)
if (Points.size() > 1)
// Fill in previous X values (before 1st point)
for (int x = 0; x < p1.co.X; x++)
Values.push_back(Coordinate(Values.size(), p1.co.Y));
else
// Add a single value (since we only have 1 point)
Values.push_back(Coordinate(Values.size(), p1.co.Y));
// Loop through each pair of points (1 less than the max points). Each