mirror of
https://github.com/konvajs/konva.git
synced 2025-04-05 20:48:28 +08:00
unit test for filters + pixelRatio
This commit is contained in:
parent
d082bcfd7f
commit
de60359b48
@ -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>
|
||||
|
28
test/unit/filters/Filter-test.js
Normal file
28
test/unit/filters/Filter-test.js
Normal 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;
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
Block a user