mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-22 07:19:57 -05:00
Simplify Path constructor further.
This commit is contained in:
parent
e35fb1efb6
commit
fc0d3efd29
1 changed files with 1 additions and 2 deletions
|
@ -17,13 +17,12 @@
|
|||
var Path = this.Path = PathItem.extend({
|
||||
beans: true,
|
||||
|
||||
initialize: function(/* segments */) {
|
||||
initialize: function(segments) {
|
||||
this.base();
|
||||
this.closed = false;
|
||||
// Support both passing of segments as array or arguments
|
||||
// If it is an array, it can also be a description of a point, so
|
||||
// check its first entry for object as well
|
||||
var segments = arguments[0];
|
||||
this.setSegments(!segments || !Array.isArray(segments)
|
||||
|| typeof segments[0] != 'object' ? arguments : segments);
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue