fixed up Circle and Ellipse tests

This commit is contained in:
Eric Rowell
2013-12-03 22:01:22 -08:00
parent 8c8cf0492c
commit acd9518ab9
4 changed files with 101 additions and 76 deletions

View File

@@ -61,20 +61,16 @@
Kinetic.Util.extend(Kinetic.Ellipse, Kinetic.Shape);
// add getters setters
Kinetic.Factory.addPointGetterSetter(Kinetic.Ellipse, 'radius', 0);
Kinetic.Factory.addGetterSetter(Kinetic.Ellipse, 'radius', {x:0,y:0});
/**
* set radius
* @name setRadius
* @method
* @memberof Kinetic.Ellipse.prototype
* @param {Object|Array} radius
* radius can be a number, in which the ellipse becomes a circle,
* it can be an object with an x and y component, or it
* can be an array in which the first element is the x component
* and the second element is the y component. The x component
* defines the horizontal radius and the y component
* defines the vertical radius
* @param {Object} radius
* @param {Number} radius.x
* @param {Number} radius.y
*/
/**
@@ -84,4 +80,39 @@
* @memberof Kinetic.Ellipse.prototype
* @returns {Object}
*/
Kinetic.Factory.addComponentGetterSetter(Kinetic.Ellipse, 'radius', 'x', 0);
/**
* set radius x
* @name setRadiusX
* @method
* @memberof Kinetic.Ellipse.prototype
* @param {Number} x
*/
/**
* get radius x
* @name getRadiusX
* @method
* @memberof Kinetic.Ellipse.prototype
* @returns {Number}
*/
Kinetic.Factory.addComponentGetterSetter(Kinetic.Ellipse, 'radius', 'y', 0);
/**
* set radius y
* @name setRadiusY
* @method
* @memberof Kinetic.Ellipse.prototype
* @param {Number} y
*/
/**
* get radius y
* @name getRadiusY
* @method
* @memberof Kinetic.Ellipse.prototype
* @returns {Number}
*/
})();