Merge pull request #927 from sapics/minor-minifier

Simplify calculation in PathFitter
This commit is contained in:
Jürg Lehni 2016-01-26 17:00:02 +01:00
commit 87e6c0f2c3

View file

@ -99,9 +99,8 @@ var PathFitter = Base.extend({
maxError = max.error;
}
// Fitting failed -- split at max error point and fit recursively
var V1 = this.points[split - 1].subtract(this.points[split]),
V2 = this.points[split].subtract(this.points[split + 1]),
tanCenter = V1.add(V2).divide(2).normalize();
var tanCenter = this.points[split - 1].subtract(this.points[split + 1])
.normalize();
this.fitCubic(first, split, tan1, tanCenter);
this.fitCubic(split, last, tanCenter.negate(), tan2);
},