fix recache bug

This commit is contained in:
Anton Lavrenov
2019-02-23 09:40:32 -05:00
parent 1c1f2adacc
commit 472bb1cf63
3 changed files with 79 additions and 1320 deletions

View File

@@ -1126,4 +1126,32 @@ suite('Caching', function() {
assert.equal(d[0], 0, 'no red');
assert.equal(d[2], 255, 'see blue');
});
it('recache with filters', function() {
var stage = addStage();
var layer = new Konva.Layer();
stage.add(layer);
var bigCircle = new Konva.Circle({
x: 100,
y: 100,
radius: 100,
fill: 'red',
draggable: true
});
layer.add(bigCircle);
bigCircle.filters([Konva.Filters.Blur]);
bigCircle.blurRadius(10);
bigCircle.cache();
layer.draw();
bigCircle.cache();
layer.draw();
var d = layer.getContext().getImageData(100, 100, 1, 1).data;
assert.equal(d[0], 255, 'see red');
});
});