diff --git a/src/basic/Line.js b/src/basic/Line.js index 15224a70..d09247ca 100644 --- a/src/basic/Line.js +++ b/src/basic/Line.js @@ -34,15 +34,16 @@ var Line = this.Line = Base.extend(/** @lends Line# */{ // intersection outside the line segment are allowed. // With two parameters, the 2nd parameter is a direction, and infinite // is automatially true, since we're describing an infinite line. - point1 = Point.read(arguments); - point2 = Point.read(arguments); - if (arguments.length == 3) { - this.point = point1; - this.vector = point2.subtract(point1); - this.infinite = infinite; + var _point1 = Point.read(arguments), + _point2 = Point.read(arguments), + _infinite = Base.readValue(arguments); + if (_infinite !== undefined) { + this.point = _point1; + this.vector = _point2.subtract(_point1); + this.infinite = _infinite; } else { - this.point = point1; - this.vector = point2; + this.point = _point1; + this.vector = _point2; this.infinite = true; } },