mirror of
https://github.com/konvajs/konva.git
synced 2026-03-03 16:58:33 +08:00
fixed up Circle and Ellipse tests
This commit is contained in:
@@ -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}
|
||||
*/
|
||||
})();
|
||||
Reference in New Issue
Block a user