Minor code tweaks.

This commit is contained in:
Jürg Lehni 2015-09-11 12:07:27 +02:00
parent c69ea345da
commit 86f404123e
3 changed files with 5 additions and 8 deletions

View file

@ -1330,8 +1330,8 @@ new function() { // Scope for intersection using bezier fat-line clipping
var reparametrize = param.reparametrize;
if (reparametrize) {
var res = reparametrize(t1, t2);
t1 = res.t1;
t2 = res.t2;
t1 = res[0];
t2 = res[1];
}
loc = new CurveLocation(c1, t1, p1 || Curve.getPoint(v1, t1),
null, overlap,

View file

@ -103,7 +103,7 @@ var PathItem = Item.extend(/** @lends PathItem# */{
if (l1.intersect(l2, false)) {
// Self intersecting is found by dividing the curve in two
// and and then applying the normal curve intersection code.
var parts = Curve.subdivide(values1);
var parts = Curve.subdivide(values1, 0.5);
Curve._getIntersections(parts[0], parts[1], curve1, curve1,
locations, {
// Only possible if there is only one closed curve:
@ -113,10 +113,7 @@ var PathItem = Item.extend(/** @lends PathItem# */{
reparametrize: function(t1, t2) {
// Since the curve was split above, we need to
// adjust the parameters for both locations.
return {
t1: t1 / 2,
t2: (1 + t2) / 2
};
return [t1 / 2, (1 + t2) / 2];
}
}
);

View file

@ -58,7 +58,7 @@ var PathIterator = Base.extend({
// appears to offer a good trade-off between speed and
// precision for display purposes.
&& !Curve.isFlatEnough(curve, tolerance || 0.25)) {
var split = Curve.subdivide(curve),
var split = Curve.subdivide(curve, 0.5),
halfT = (minT + maxT) / 2;
// Recursively subdivide and compute parts again.
computeParts(split[0], index, minT, halfT);