fixed Polygon points default attr issue

This commit is contained in:
Eric Rowell
2013-04-04 22:48:37 -07:00
parent 6a1ec5db4c
commit 280e07a2af

View File

@@ -41,16 +41,17 @@
*/
setPoints: function(val) {
this.setAttr('points', Kinetic.Type._getPoints(val));
}
};
Kinetic.Global.extend(Kinetic.Polygon, Kinetic.Shape);
// add getters setters
Kinetic.Node.addGetter(Kinetic.Polygon, 'points', []);
},
/**
* get points array
* @name getPoints
* @methodOf Kinetic.Polygon.prototype
*/
// NOTE: cannot use getter method because we need to return a new
// default array literal each time because arrays are modified by reference
getPoints: function() {
return this.attrs.points || [];
}
};
Kinetic.Global.extend(Kinetic.Polygon, Kinetic.Shape);
})();