mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Improve argument reading in PostScript drawing methods.
This commit is contained in:
parent
56c10f9196
commit
5a1d31bba7
1 changed files with 5 additions and 4 deletions
|
@ -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),
|
||||
|
|
Loading…
Reference in a new issue