diff --git a/Thorfile b/Thorfile index 6c0d7498..c3afd6c3 100644 --- a/Thorfile +++ b/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. FILES = [ "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/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" ] diff --git a/src/filters/ Gauss.js b/src/filters/Gauss.js similarity index 100% rename from src/filters/ Gauss.js rename to src/filters/Gauss.js diff --git a/tests/js/functionalTests.js b/tests/js/functionalTests.js index 33c0b644..62b26b50 100644 --- a/tests/js/functionalTests.js +++ b/tests/js/functionalTests.js @@ -270,7 +270,7 @@ Test.Modules.DD = { }; Test.Modules.EVENT = { - '*text events': function(containerId) { + 'text events': function(containerId) { var stage = new Kinetic.Stage({ container: containerId, width: 578, diff --git a/tests/js/unit/shapes/imageTests.js b/tests/js/unit/shapes/imageTests.js index 569969c2..5ff56959 100644 --- a/tests/js/unit/shapes/imageTests.js +++ b/tests/js/unit/shapes/imageTests.js @@ -295,6 +295,42 @@ Test.Modules.IMAGE = { }; 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) { var imageObj = new Image(); imageObj.onload = function() {