From 268e776251842564a61effa20369498fcfac9987 Mon Sep 17 00:00:00 2001 From: Jonathan Thomas Date: Thu, 4 Oct 2012 14:13:13 -0500 Subject: [PATCH] Fixed a bug with Keyframes that only have a single coordinate, to correctly return that Y value for any requested X position. --- src/KeyFrame.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/KeyFrame.cpp b/src/KeyFrame.cpp index a9cafb2e..3bf954c3 100644 --- a/src/KeyFrame.cpp +++ b/src/KeyFrame.cpp @@ -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