unit test for filters + pixelRatio

This commit is contained in:
lavrton 2015-04-14 09:45:10 +07:00
parent d082bcfd7f
commit de60359b48
2 changed files with 29 additions and 0 deletions

View File

@ -150,6 +150,7 @@
<script src="unit/plugins/Arrow-test.js"></script>
<!-- filters -->
<script src="unit/filters/Filter-test.js"></script>
<script src="unit/filters/Blur-test.js"></script>
<script src="unit/filters/Brighten-test.js"></script>
<script src="unit/filters/RGB-test.js"></script>

View File

@ -0,0 +1,28 @@
"use strict";
suite.only('Filter', function() {
test('pixelRaio check', function () {
Konva.pixelRatio = 2;
var stage = addStage();
var layer = new Konva.Layer();
var circle = new Konva.Circle({
x : stage.width() / 2,
y : stage.height() / 2,
fill : 'red',
stroke: 'green',
radius : 15
});
layer.add(circle);
stage.add(layer);
circle.cache();
circle.filters([Konva.Filters.Blur ]);
circle.blurRadius(0);
layer.draw();
cloneAndCompareLayer(layer, 20);
Konva.pixelRatio = 1;
});
});