Fixed a few issues with Color keyframes

This commit is contained in:
Jonathan Thomas
2015-10-01 18:51:59 -05:00
parent af3ad48455
commit ac7be90544
3 changed files with 4 additions and 3 deletions

View File

@@ -202,10 +202,10 @@ Point Keyframe::GetClosestPoint(Point p) {
// Handle edge cases (if no point was found)
if (closest.co.X == -1) {
if (p.co.X < 1)
if (p.co.X < 1 && Points.size() > 0)
// Assign 1st point
closest = Points[0];
else
else if (Points.size() > 0)
// Assign last point
closest = Points[Points.size() - 1];
}