Simplify Path constructor further.

This commit is contained in:
Jürg Lehni 2011-03-08 13:03:57 +00:00
parent e35fb1efb6
commit fc0d3efd29

View file

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