mirror of
https://github.com/konvajs/konva.git
synced 2026-01-23 21:34:50 +08:00
tied className into toJSON and create. deprecated shapeType property and getShapeType method
This commit is contained in:
@@ -60,7 +60,7 @@ Test.Modules.BLOB = {
|
||||
test(blob1.getTension() === 0.8, 'blob1 tension should be 0.8');
|
||||
test(blob2.getTension() === 1.2, 'blob2 tension should be 1.2');
|
||||
|
||||
test(blob1.getShapeType() === 'Blob', 'shape type should be Blob');
|
||||
test(blob1.getClassName() === 'Blob', 'getClassName should be Blob');
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ Test.Modules.CIRCLE = {
|
||||
test(attrs.strokeWidth === 4, 'strokeWidth attr should be strokeWidth');
|
||||
test(attrs.name === 'myCircle', 'name attr should be myCircle');
|
||||
test(attrs.draggable === true, 'draggable attr should be true');
|
||||
test(circle.getShapeType() === 'Circle', 'shape type should be Circle');
|
||||
test(circle.getClassName() === 'Circle', 'getClassName should be Circle');
|
||||
},
|
||||
'add circle with pattern fill': function(containerId) {
|
||||
var imageObj = new Image();
|
||||
|
||||
@@ -118,7 +118,7 @@ Test.Modules.IMAGE = {
|
||||
|
||||
//document.body.appendChild(layer.bufferCanvas.element)
|
||||
|
||||
test(darth.getShapeType() === 'Image', 'shape type should be Image');
|
||||
test(darth.getClassName() === 'Image', 'getClassName should be Image');
|
||||
|
||||
};
|
||||
imageObj.src = '../assets/darth-vader.jpg';
|
||||
|
||||
@@ -47,7 +47,7 @@ Test.Modules.LINE = {
|
||||
line.setPoints([73, 160, 340, 23]);
|
||||
test(line.getPoints()[0].x === 73, 'first point x should be 73');
|
||||
|
||||
test(line.getShapeType() === 'Line', 'shape type should be Line');
|
||||
test(line.getClassName() === 'Line', 'getClassName should be Line');
|
||||
},
|
||||
'test default ponts array for two lines': function(containerId) {
|
||||
var stage = new Kinetic.Stage({
|
||||
|
||||
@@ -37,7 +37,7 @@ Test.Modules.POLYGON - {
|
||||
layer.add(poly);
|
||||
stage.add(layer);
|
||||
|
||||
test(poly.getShapeType() === 'Polygon', 'shape type should be Polygon');
|
||||
test(poly.getClassName() === 'Polygon', 'getClassName should be Polygon');
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
@@ -25,7 +25,7 @@ Test.Modules.RECT = {
|
||||
layer.add(rect);
|
||||
stage.add(layer);
|
||||
|
||||
test(rect.getShapeType() === 'Rect', 'shape type should be Rect');
|
||||
test(rect.getClassName() === 'Rect', 'className should be Rect');
|
||||
},
|
||||
'add stroke rect': function(containerId) {
|
||||
var stage = new Kinetic.Stage({
|
||||
|
||||
@@ -79,7 +79,7 @@ Test.Modules.SPLINE = {
|
||||
//console.log(layer.toDataURL());
|
||||
testDataUrl(layer.toDataURL(), 'curvy lines', 'problem with curvy lines');
|
||||
|
||||
test(line1.getShapeType() === 'Spline', 'shape type should be Spline');
|
||||
test(line1.getClassName() === 'Spline', 'getClassName should be Spline');
|
||||
|
||||
},
|
||||
'create from points represented as a flat array': function(containerId) {
|
||||
|
||||
@@ -112,7 +112,7 @@ Test.Modules.SPRITE = {
|
||||
}, 3000);
|
||||
//document.body.appendChild(layer.bufferCanvas.element)
|
||||
|
||||
test(sprite.getShapeType() === 'Sprite', 'shape type should be Sprite');
|
||||
test(sprite.getClassName() === 'Sprite', 'getClassName should be Sprite');
|
||||
|
||||
test(sprite.getIndex() === 0, 'sprite index should default to 0');
|
||||
};
|
||||
|
||||
@@ -55,7 +55,7 @@ Test.Modules.Text = {
|
||||
layer.add(group);
|
||||
stage.add(layer);
|
||||
|
||||
test(text.getShapeType() === 'Text', 'shape type should be Text');
|
||||
test(text.getClassName() === 'Text', 'getClassName should be Text');
|
||||
},
|
||||
'text getters and setters': function(containerId) {
|
||||
var stage = new Kinetic.Stage({
|
||||
|
||||
@@ -24,7 +24,7 @@ Test.Modules.Wedge = {
|
||||
//console.log(layer.toDataURL());
|
||||
testDataUrl(layer.toDataURL(), 'wedge', 'problem rendering wedge');
|
||||
|
||||
test(wedge.getShapeType() === 'Wedge', 'shape type should be Wedge');
|
||||
test(wedge.getClassName() === 'Wedge', 'getClassName should be Wedge');
|
||||
},
|
||||
'set wedge angle using degrees': function(containerId) {
|
||||
var stage = new Kinetic.Stage({
|
||||
|
||||
Reference in New Issue
Block a user