mirror of
https://github.com/konvajs/konva.git
synced 2025-09-18 18:00:36 +08:00
gauss cleanup
This commit is contained in:
2
Thorfile
2
Thorfile
@@ -5,7 +5,7 @@ class Build < Thor
|
|||||||
# This is the list of files to concatenate. The first file will appear at the top of the final file. All files are relative to the lib directory.
|
# This is the list of files to concatenate. The first file will appear at the top of the final file. All files are relative to the lib directory.
|
||||||
FILES = [
|
FILES = [
|
||||||
"src/Global.js", "src/util/Type.js", "src/Canvas.js", "src/util/Tween.js", "src/util/Transform.js", "src/util/Collection.js",
|
"src/Global.js", "src/util/Type.js", "src/Canvas.js", "src/util/Tween.js", "src/util/Transform.js", "src/util/Collection.js",
|
||||||
"src/filters/Grayscale.js", "src/filters/Brighten.js", "src/filters/Invert.js",
|
"src/filters/Grayscale.js", "src/filters/Brighten.js", "src/filters/Invert.js", "src/filters/Gauss.js",
|
||||||
"src/Node.js", "src/Animation.js", "src/DragAndDrop.js", "src/Transition.js", "src/Container.js", "src/Shape.js", "src/Stage.js", "src/Layer.js", "src/Group.js",
|
"src/Node.js", "src/Animation.js", "src/DragAndDrop.js", "src/Transition.js", "src/Container.js", "src/Shape.js", "src/Stage.js", "src/Layer.js", "src/Group.js",
|
||||||
"src/shapes/Rect.js", "src/shapes/Circle.js", "src/shapes/Wedge.js", "src/shapes/Ellipse.js", "src/shapes/Image.js", "src/shapes/Polygon.js", "src/shapes/Text.js", "src/shapes/Line.js", "src/shapes/Spline.js", "src/shapes/Blob.js", "src/shapes/Sprite.js", "src/shapes/Star.js", "src/shapes/RegularPolygon.js", "src/shapes/Path.js", "src/shapes/TextPath.js"
|
"src/shapes/Rect.js", "src/shapes/Circle.js", "src/shapes/Wedge.js", "src/shapes/Ellipse.js", "src/shapes/Image.js", "src/shapes/Polygon.js", "src/shapes/Text.js", "src/shapes/Line.js", "src/shapes/Spline.js", "src/shapes/Blob.js", "src/shapes/Sprite.js", "src/shapes/Star.js", "src/shapes/RegularPolygon.js", "src/shapes/Path.js", "src/shapes/TextPath.js"
|
||||||
]
|
]
|
||||||
|
@@ -270,7 +270,7 @@ Test.Modules.DD = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
Test.Modules.EVENT = {
|
Test.Modules.EVENT = {
|
||||||
'*text events': function(containerId) {
|
'text events': function(containerId) {
|
||||||
var stage = new Kinetic.Stage({
|
var stage = new Kinetic.Stage({
|
||||||
container: containerId,
|
container: containerId,
|
||||||
width: 578,
|
width: 578,
|
||||||
|
@@ -295,6 +295,42 @@ Test.Modules.IMAGE = {
|
|||||||
};
|
};
|
||||||
imageObj.src = '../assets/darth-vader.jpg';
|
imageObj.src = '../assets/darth-vader.jpg';
|
||||||
},
|
},
|
||||||
|
'*gaussian blur filter': function(containerId) {
|
||||||
|
var imageObj = new Image();
|
||||||
|
imageObj.onload = function() {
|
||||||
|
var stage = new Kinetic.Stage({
|
||||||
|
container: containerId,
|
||||||
|
width: 578,
|
||||||
|
height: 200
|
||||||
|
});
|
||||||
|
var layer = new Kinetic.Layer({
|
||||||
|
throttle: 999
|
||||||
|
});
|
||||||
|
darth = new Kinetic.Image({
|
||||||
|
x: 10,
|
||||||
|
y: 10,
|
||||||
|
image: imageObj,
|
||||||
|
draggable: true
|
||||||
|
});
|
||||||
|
|
||||||
|
layer.add(darth);
|
||||||
|
stage.add(layer);
|
||||||
|
|
||||||
|
test(darth.getWidth() === 438, 'image width should be 438');
|
||||||
|
test(darth.getHeight() === 300, 'image height should be 300');
|
||||||
|
|
||||||
|
darth.applyFilter(Kinetic.Filters.Gauss, {
|
||||||
|
radius: 10
|
||||||
|
}, function() {
|
||||||
|
layer.draw();
|
||||||
|
var dataUrl = layer.toDataURL();
|
||||||
|
//console.log(dataUrl);
|
||||||
|
warn(dataUrl === dataUrls['adjust image brightness'], 'problem with Brighten filter.');
|
||||||
|
|
||||||
|
});
|
||||||
|
};
|
||||||
|
imageObj.src = '../assets/darth-vader.jpg';
|
||||||
|
},
|
||||||
'filter transformed image': function(containerId) {
|
'filter transformed image': function(containerId) {
|
||||||
var imageObj = new Image();
|
var imageObj = new Image();
|
||||||
imageObj.onload = function() {
|
imageObj.onload = function() {
|
||||||
|
Reference in New Issue
Block a user