mirror of
https://github.com/konvajs/konva.git
synced 2025-10-15 12:34:52 +08:00
deprecated Ellipse shape, since you can create ellipses now with circles. updated tests
This commit is contained in:
@@ -366,13 +366,10 @@ Test.Modules.SHAPE = {
|
||||
fill: 'red'
|
||||
});
|
||||
|
||||
var ellipse = new Kinetic.Ellipse({
|
||||
var ellipse = new Kinetic.Circle({
|
||||
x: stage.getWidth() / 2,
|
||||
y: stage.getHeight() / 2,
|
||||
radius: {
|
||||
x: 100,
|
||||
y: 50
|
||||
},
|
||||
radius: 50,
|
||||
fill: 'yellow'
|
||||
});
|
||||
|
||||
@@ -381,8 +378,6 @@ Test.Modules.SHAPE = {
|
||||
stage.add(layer);
|
||||
|
||||
// circle tests
|
||||
test(circle.attrs.width === undefined, 'circle.attrs.width should be undefined');
|
||||
test(circle.attrs.height === undefined, 'circle.attrs.height should be undefined');
|
||||
test(circle.getWidth() === 100, 'circle width should be 100');
|
||||
test(circle.getHeight() === 100, 'circle height should be 100');
|
||||
test(circle.getSize().width === 100, 'circle width should be 100');
|
||||
@@ -391,32 +386,12 @@ Test.Modules.SHAPE = {
|
||||
|
||||
circle.setWidth(200);
|
||||
|
||||
test(circle.attrs.width === 200, 'circle.attrs.width should be 200');
|
||||
test(circle.attrs.height === undefined, 'circle.attrs.height should be undefined');
|
||||
test(circle.getWidth() === 200, 'circle width should be 200');
|
||||
test(circle.getHeight() === 200, 'circle height should be 200');
|
||||
test(circle.getSize().width === 200, 'circle width should be 200');
|
||||
test(circle.getSize().height === 200, 'circle height should be 200');
|
||||
test(circle.getRadius() === 100, 'circle radius should be 100');
|
||||
|
||||
// ellipse tests
|
||||
test(ellipse.attrs.width === undefined, 'ellipse.attrs.width should be undefined');
|
||||
test(ellipse.attrs.height === undefined, 'ellipse.attrs.height should be undefined');
|
||||
test(ellipse.getWidth() === 200, 'ellipse width should be 200');
|
||||
test(ellipse.getHeight() === 100, 'ellipse height should be 100');
|
||||
test(ellipse.getSize().width === 200, 'ellipse width should be 200');
|
||||
test(ellipse.getSize().height === 100, 'ellipse height should be 100');
|
||||
test(ellipse.getRadius().x === 100, 'ellipse radius x should be 100');
|
||||
|
||||
ellipse.setWidth(400);
|
||||
|
||||
test(ellipse.attrs.width === 400, 'ellipse.attrs.width should be 400');
|
||||
test(ellipse.attrs.height === undefined, 'ellipse.attrs.height should be undefined');
|
||||
test(ellipse.getWidth() === 400, 'ellipse width should be 400');
|
||||
test(ellipse.getHeight() === 100, 'ellipse height should be 100');
|
||||
test(ellipse.getSize().width === 400, 'ellipse width should be 400');
|
||||
test(ellipse.getSize().height === 100, 'ellipse height should be 100');
|
||||
test(ellipse.getRadius().x === 200, 'ellipse radius x should be 200');
|
||||
|
||||
},
|
||||
'set image fill to color then image then linear gradient then back to image': function(containerId) {
|
||||
|
Reference in New Issue
Block a user