removed john resig's Class class because it was really slowing down node instantiations. Created a custom solution that's much lighter weight, and about 50% faster

This commit is contained in:
Eric Rowell
2012-08-22 23:35:21 -07:00
parent 45cf237ce0
commit 1ad2530889
18 changed files with 2279 additions and 126 deletions

View File

@@ -7,8 +7,12 @@
* @augments Kinetic.Shape
* @param {Object} config
*/
Kinetic.Ellipse = Kinetic.Shape.extend({
init: function(config) {
Kinetic.Ellipse = function(config) {
this._initEllipse(config);
};
Kinetic.Ellipse.prototype = {
_initEllipse: function(config) {
this.setDefaultAttrs({
radius: {
x: 0,
@@ -20,7 +24,7 @@ Kinetic.Ellipse = Kinetic.Shape.extend({
config.drawFunc = this.drawFunc;
// call super constructor
this._super(config);
Kinetic.Shape.call(this, config);
this._convertRadius();
var that = this;
this.on('radiusChange.kinetic', function() {
@@ -57,7 +61,8 @@ Kinetic.Ellipse = Kinetic.Shape.extend({
*/
this.attrs.radius = type._getXY(radius);
}
});
};
Kinetic.Global.extend(Kinetic.Ellipse, Kinetic.Shape);
// Circle backwards compatibility
Kinetic.Circle = Kinetic.Ellipse;