mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-05 20:32:00 -05:00
Clean up Path#moveTo() and #lineTo() commands.
This commit is contained in:
parent
516557808e
commit
728bf0441c
1 changed files with 6 additions and 6 deletions
|
@ -676,15 +676,15 @@ var Path = this.Path = PathItem.extend({
|
|||
*/
|
||||
return {
|
||||
moveTo: function() {
|
||||
var segment = new Segment(Point.read(arguments));
|
||||
if (segment && !this._segments.length)
|
||||
this._add(segment);
|
||||
// Let's not be picky about calling moveTo() when not at the
|
||||
// beginning of a path, just bail out:
|
||||
if (!this._segments.length)
|
||||
this._add(new Segment(Point.read(arguments)));
|
||||
},
|
||||
|
||||
lineTo: function() {
|
||||
var segment = new Segment(Point.read(arguments));
|
||||
if (segment)
|
||||
this._add(segment);
|
||||
// Let's not be picky about calling moveTo() first:
|
||||
this._add(new Segment(Point.read(arguments)));
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue