From 5a1d31bba79879fe3b36761e59a9cc96dfea2680 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sun, 6 Mar 2011 11:23:21 +0000 Subject: [PATCH] Improve argument reading in PostScript drawing methods. --- src/path/Path.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/path/Path.js b/src/path/Path.js index b3bc085d..f21fac2d 100644 --- a/src/path/Path.js +++ b/src/path/Path.js @@ -170,13 +170,13 @@ var Path = this.Path = PathItem.extend({ }, moveTo: function() { - var segment = Segment.read(arguments); + var segment = new Segment(Point.read(arguments)); if (segment && !this._segments.length) this._add(segment); }, lineTo: function() { - var segment = Segment.read(arguments); + var segment = new Segment(Point.read(arguments)); if (segment) this._add(segment); }, @@ -243,9 +243,10 @@ var Path = this.Path = PathItem.extend({ // Get the start point: var current = this.currentSegment; if (arguments[1] && typeof arguments[1] != 'boolean') { - through = new Point(arguments[0]); - to = new Point(arguments[1]); + through = Point.read(arguments, 0, 1); + to = Point.read(arguments, 1, 1); } else { + to = Point.read(arguments, 0, 1); if (clockwise === null) clockwise = true; var middle = current._point.add(to).divide(2),