Remove Curve#isHorizontal() as its implementation and precision is specific to boolean operations.

This commit is contained in:
Jürg Lehni 2015-01-03 21:02:12 +01:00
parent 46d7717812
commit b6a4815d03
2 changed files with 4 additions and 6 deletions

View file

@ -301,11 +301,6 @@ var Curve = Base.extend(/** @lends Curve# */{
&& this._segment2._handleIn.isZero();
},
isHorizontal: function() {
return this.isLinear() && Numerical.isZero(
this._segment1._point._y - this._segment2._point._y);
},
// DOCS: Curve#getIntersections()
getIntersections: function(curve) {
return Curve.filterIntersections(Curve.getIntersections(

View file

@ -124,7 +124,10 @@ PathItem.inject(new function() {
length = curveLength / 2;
var curve = node.segment.getCurve(),
pt = curve.getPointAt(length),
hor = curve.isHorizontal(),
// Determine if the curve is a horizontal linear
// curve by checking the slope of it's tangent.
hor = curve.isLinear() && Math.abs(curve
.getTangentAt(0.5, true).y) <= tolerance,
path = curve._path;
if (path._parent instanceof CompoundPath)
path = path._parent;