Remove CurveLocation#getOffsetTo() again.

This commit is contained in:
Jürg Lehni 2017-02-22 17:05:23 +01:00
parent e3828d810b
commit 919615f168
2 changed files with 3 additions and 18 deletions

View file

@ -2212,8 +2212,8 @@ new function() { // Scope for bezier intersection using fat-line clipping
if (pairs.length !== 2) { if (pairs.length !== 2) {
pairs = null; pairs = null;
} else if (!straightBoth) { } else if (!straightBoth) {
// Straight pairs don't need further checks. If we found // Straight pairs don't need further checks. If we found 2 pairs,
// 2 pairs, the end points on v1 & v2 should be the same. // the end points on v1 & v2 should be the same.
var o1 = Curve.getPart(v1, pairs[0][0], pairs[1][0]), var o1 = Curve.getPart(v1, pairs[0][0], pairs[1][0]),
o2 = Curve.getPart(v2, pairs[0][1], pairs[1][1]); o2 = Curve.getPart(v2, pairs[0][1], pairs[1][1]);
// Check if handles of the overlapping curves are the same too. // Check if handles of the overlapping curves are the same too.

View file

@ -290,7 +290,7 @@ var CurveLocation = Base.extend(/** @lends CurveLocation# */{
return this._distance; return this._distance;
}, },
// DOCS: divide(), split(), getOffsetTo(loc) // DOCS: divide(), split()
divide: function() { divide: function() {
var curve = this.getCurve(), var curve = this.getCurve(),
@ -313,21 +313,6 @@ var CurveLocation = Base.extend(/** @lends CurveLocation# */{
return res; return res;
}, },
getOffsetTo: function(loc) {
var offset = null,
path = this.getPath();
if (path && path === loc.getPath()) {
var offset1 = this.getOffset(),
offset2 = loc.getOffset();
offset = offset2 - offset1;
if (offset < 0 && path._closed) {
// Wrap around the end of the path back to the beginning.
offset = path.getLength() - offset2 + offset1;
}
}
return offset;
},
/** /**
* Checks whether tow CurveLocation objects are describing the same location * Checks whether tow CurveLocation objects are describing the same location
* on a path, by applying the same tolerances as elsewhere when dealing with * on a path, by applying the same tolerances as elsewhere when dealing with