imageSmoothingEnabled for export functions. close #1320

This commit is contained in:
Anton Lavrenov
2022-04-11 18:20:09 -05:00
parent 7988800c01
commit e88ed2c28c
5 changed files with 50 additions and 8 deletions

View File

@@ -445,6 +445,36 @@ describe('Node', function () {
assert.equal(oldURL, newURL);
});
// ======================================================
it('export with smooth disabled', function (done) {
loadImage('lion.png', (imageObj) => {
var stage = addStage();
var layer = new Konva.Layer({
imageSmoothingEnabled: false,
});
stage.add(layer);
var image = new Konva.Image({
x: -50,
y: -50,
image: imageObj,
scaleX: 5,
scaleY: 5,
});
layer.add(image);
const canvas = layer.toCanvas({
imageSmoothingEnabled: false,
pixelRatio: layer.getCanvas().getPixelRatio(),
});
layer.draw();
compareLayerAndCanvas(layer, canvas);
// just check clone without crashes
done();
});
});
// ======================================================
it("listen and don't listen", function () {
var stage = addStage();