mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Remove Curve#isHorizontal() as its implementation and precision is specific to boolean operations.
This commit is contained in:
parent
46d7717812
commit
b6a4815d03
2 changed files with 4 additions and 6 deletions
|
@ -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(
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue