added Circle backwards compatibility with Ellipse

This commit is contained in:
Eric Rowell
2012-06-18 19:09:07 -07:00
parent 2c0aabcb9c
commit dee78e86e2
4 changed files with 25 additions and 1 deletions

View File

@@ -3403,6 +3403,9 @@ Kinetic.Ellipse = function(config) {
Kinetic.Shape.apply(this, [config]);
};
// Circle backwards compatibility
Kinetic.Circle = Kinetic.Ellipse;
Kinetic.Ellipse.prototype = {
/**
* set radius

File diff suppressed because one or more lines are too long

View File

@@ -36,6 +36,9 @@ Kinetic.Ellipse = function(config) {
Kinetic.Shape.apply(this, [config]);
};
// Circle backwards compatibility
Kinetic.Circle = Kinetic.Ellipse;
Kinetic.Ellipse.prototype = {
/**
* set radius

View File

@@ -1282,6 +1282,24 @@ Test.prototype.tests = {
layer.add(Ellipse);
stage.add(layer);
},
'SHAPE - add circle using Circle': function(containerId) {
var stage = new Kinetic.Stage({
container: containerId,
width: 578,
height: 200
});
var layer = new Kinetic.Layer();
var circle = new Kinetic.Circle({
x: stage.getWidth() / 2,
y: stage.getHeight() / 2,
radius: 70,
fill: 'green',
stroke: 'black',
strokeWidth: 4
});
layer.add(circle);
stage.add(layer);
},
'SHAPE - add ellipse': function(containerId) {
var stage = new Kinetic.Stage({
container: containerId,