mirror of
https://github.com/konvajs/konva.git
synced 2025-09-19 10:47:59 +08:00
it turns out that there was only a problem with moveDown. refactored logic proposed by Adam
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
test.run();
|
||||
|
||||
document.getElementsByTagName('body')[0].addEventListener('mousemove', function(evt) {
|
||||
console.log(evt.clientX + ',' + evt.clientY);
|
||||
//console.log(evt.clientX + ',' + evt.clientY);
|
||||
}, false);
|
||||
};
|
||||
</script>
|
||||
|
@@ -4228,6 +4228,41 @@ Test.prototype.tests = {
|
||||
|
||||
layer.draw();
|
||||
},
|
||||
'*LAYERING - layer layer when only one layer': function(containerId) {
|
||||
var stage = new Kinetic.Stage({
|
||||
container: containerId,
|
||||
width: 578,
|
||||
height: 200
|
||||
});
|
||||
var layer = new Kinetic.Layer();
|
||||
|
||||
var bluecircle = new Kinetic.Circle({
|
||||
x: 200,
|
||||
y: stage.getHeight() / 2,
|
||||
radius: 70,
|
||||
fill: 'blue',
|
||||
stroke: 'black',
|
||||
strokeWidth: 4
|
||||
});
|
||||
|
||||
layer.add(bluecircle);
|
||||
stage.add(layer);
|
||||
|
||||
test(layer.getZIndex() === 0, 'layer should have zindex of 0');
|
||||
|
||||
layer.moveDown();
|
||||
test(layer.getZIndex() === 0, 'layer should have zindex of 0');
|
||||
|
||||
layer.moveToBottom();
|
||||
test(layer.getZIndex() === 0, 'layer should have zindex of 0');
|
||||
|
||||
layer.moveUp();
|
||||
test(layer.getZIndex() === 0, 'layer should have zindex of 0');
|
||||
|
||||
layer.moveToTop();
|
||||
test(layer.getZIndex() === 0, 'layer should have zindex of 0');
|
||||
|
||||
},
|
||||
'LAYERING - move blue group on top of green group with moveToTop': function(containerId) {
|
||||
var stage = new Kinetic.Stage({
|
||||
container: containerId,
|
||||
|
Reference in New Issue
Block a user