Improve handling of locations with invalid curves in divideLocations()

This commit is contained in:
Jürg Lehni 2017-01-03 00:20:10 +01:00
parent b743f456b3
commit 0018b69e4d

View file

@ -302,11 +302,12 @@ PathItem.inject(new function() {
// a change in the cached location values, see above.
curve = loc._curve,
segment;
if (curve && curve !== prevCurve) {
if (curve) {
if (curve !== prevCurve) {
// This is a new curve, update clearHandles setting.
clearHandles = !curve.hasHandles()
|| clearLookup && clearLookup[getId(curve)];
// Only keep track of information for rescaling within the curve
// Only keep track of rescaling information within the curve
rescaleLocs = [];
prevTime = null;
} else if (prevTime > tMin) {
@ -315,6 +316,7 @@ PathItem.inject(new function() {
loc._time /= prevTime;
}
prevCurve = curve;
}
if (exclude) {
// Store this excluded location for later rescaling, in case we
// divide the same curve further to the left of this location.