mirror of
https://github.com/konvajs/konva.git
synced 2025-11-18 09:07:30 +08:00
refactored draw, _draw, and _drawChildren methods in such a way that isVisible and getListening logic resides in one place, therefore improving code quality
This commit is contained in:
@@ -363,6 +363,8 @@ Test.prototype.tests = {
|
||||
|
||||
layer.add(star);
|
||||
stage.add(layer);
|
||||
|
||||
//document.body.appendChild(layer.bufferCanvas.element)
|
||||
},
|
||||
'EVENTS - drag events click': function(containerId) {
|
||||
var stage = new Kinetic.Stage({
|
||||
|
||||
@@ -67,7 +67,7 @@ Test.prototype.tests = {
|
||||
anim.start();
|
||||
}, 4000);
|
||||
},
|
||||
'*DRAWING - draw 10,000 small circles with tooltips': function(containerId) {
|
||||
'DRAWING - draw 10,000 small circles with tooltips': function(containerId) {
|
||||
var stage = new Kinetic.Stage({
|
||||
container: containerId,
|
||||
width: 578,
|
||||
|
||||
@@ -130,7 +130,7 @@ Test.prototype.tests = {
|
||||
|
||||
test(circle.getName() === 'myCircle', 'circle name should be myCircle');
|
||||
|
||||
//document.body.appendChild(layer.bufferCanvas.element)
|
||||
document.body.appendChild(layer.bufferCanvas.element)
|
||||
},
|
||||
'STAGE - add shape with opacity': function(containerId) {
|
||||
var stage = new Kinetic.Stage({
|
||||
@@ -480,7 +480,6 @@ Test.prototype.tests = {
|
||||
|
||||
test(stage.getScale().x === 0.5, 'stage scale x should be 0.5');
|
||||
test(stage.getScale().y === 0.5, 'stage scale y should be 0.5');
|
||||
|
||||
stage.draw();
|
||||
},
|
||||
'STAGE - scale stage before add shape': function(containerId) {
|
||||
@@ -1882,11 +1881,17 @@ Test.prototype.tests = {
|
||||
y: -120
|
||||
|
||||
});
|
||||
|
||||
|
||||
layer.add(cachedShape);
|
||||
layer.draw();
|
||||
|
||||
warn(urls[0] === layer.toDataURL(), 'layer data url is incorrect');
|
||||
cachedShape.createBufferImage(function() {
|
||||
|
||||
layer.draw();
|
||||
|
||||
warn(urls[0] === layer.toDataURL(), 'layer data url is incorrect');
|
||||
|
||||
document.body.appendChild(layer.bufferCanvas.element)
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user