Improve argument reading in PostScript drawing methods.

This commit is contained in:
Jürg Lehni 2011-03-06 11:23:21 +00:00
parent 56c10f9196
commit 5a1d31bba7

View file

@ -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),