toDataURL fixes

This commit is contained in:
Anton Lavrenov
2018-07-18 14:56:46 +07:00
parent ef9cf8154d
commit 39e022e786
5 changed files with 28 additions and 4 deletions

View File

@@ -1060,6 +1060,23 @@ suite('Stage', function() {
assert.equal(stage.toDataURL(), layer.toDataURL());
});
test('toDataURL with hidden layer', function() {
var stage = addStage();
var layer = new Konva.Layer();
var circle = new Konva.Circle({
x: stage.width() / 2,
y: stage.height() / 2,
fill: 'red',
radius: 50
});
layer.add(circle);
stage.add(layer);
var stageDataUrl = stage.toDataURL();
layer.visible(false);
assert.equal(stage.toDataURL() === stageDataUrl, false);
});
test('toCanvas with large size', function() {
var stage = addStage();
var layer = new Konva.Layer();