mirror of
https://github.com/konvajs/konva.git
synced 2025-10-15 12:34:52 +08:00
added Circle backwards compatibility with Ellipse
This commit is contained in:
3
dist/kinetic-core.js
vendored
3
dist/kinetic-core.js
vendored
@@ -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
|
||||
|
2
dist/kinetic-core.min.js
vendored
2
dist/kinetic-core.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -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
|
||||
|
@@ -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,
|
||||
|
Reference in New Issue
Block a user