From 2cb39f087c947b9dfa9839b9118c5532fcaaeeea Mon Sep 17 00:00:00 2001 From: Eric Rowell Date: Thu, 4 Apr 2013 22:22:28 -0700 Subject: [PATCH] renamed the Crop filter to Mask --- Thorfile | 2 +- src/filters/{Crop.js => Mask.js} | 4 ++-- tests/js/unit/shapes/imageTests.js | 6 +++--- tests/js/unit/shapes/textTests.js | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) rename src/filters/{Crop.js => Mask.js} (98%) diff --git a/Thorfile b/Thorfile index b2f96a9b..906d7afc 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/Blur.js", "src/filters/Crop.js", + "src/filters/Grayscale.js", "src/filters/Brighten.js", "src/filters/Invert.js", "src/filters/Blur.js", "src/filters/Mask.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/plugins/Path.js", "src/plugins/TextPath.js", "src/plugins/RegularPolygon.js", "src/plugins/Star.js", "src/plugins/Label.js" diff --git a/src/filters/Crop.js b/src/filters/Mask.js similarity index 98% rename from src/filters/Crop.js rename to src/filters/Mask.js index 6a84bd7f..a7c2c928 100644 --- a/src/filters/Crop.js +++ b/src/filters/Mask.js @@ -163,7 +163,7 @@ Kinetic.Filters = Kinetic.Filters || {}; /** - * Crop Filter + * Mask Filter * * Only crop unicolor background images for instance * @@ -173,7 +173,7 @@ * @param {Object} config * @param {Integer} config.threshold The RGB euclidian distance threshold (default : 10) */ - Kinetic.Filters.Crop = function(idata, config) { + Kinetic.Filters.Mask = function(idata, config) { // Detect pixels close to the background color var mask = backgroundMask(idata, config); if (mask) { diff --git a/tests/js/unit/shapes/imageTests.js b/tests/js/unit/shapes/imageTests.js index c59e9c95..95a7e463 100644 --- a/tests/js/unit/shapes/imageTests.js +++ b/tests/js/unit/shapes/imageTests.js @@ -408,7 +408,7 @@ Test.Modules.IMAGE = { showHit(layer); }, - 'crop unicolor background filter': function(containerId) { + '*mask unicolor background filter': function(containerId) { var imageObj = new Image(); imageObj.onload = function() { var stage = new Kinetic.Stage({ @@ -436,13 +436,13 @@ Test.Modules.IMAGE = { layer.add(filtered); stage.add(layer); - filtered.applyFilter(Kinetic.Filters.Crop, { + filtered.applyFilter(Kinetic.Filters.Mask, { threshold: 10 }, function() { layer.draw(); var dataUrl = layer.toDataURL(); //console.log(dataUrl); - testDataUrl(dataUrl, 'crop filter', 'problem with Crop filter.'); + testDataUrl(dataUrl, 'mask filter', 'problem with Mask filter.'); }); }; imageObj.src = '../assets/bamoon.jpg'; diff --git a/tests/js/unit/shapes/textTests.js b/tests/js/unit/shapes/textTests.js index f988c7a7..ef12cfae 100644 --- a/tests/js/unit/shapes/textTests.js +++ b/tests/js/unit/shapes/textTests.js @@ -176,7 +176,7 @@ Test.Modules.Text = { var text = new Kinetic.Text({ x: 10, y: 10, - text: 'HEADING\n\nAll the world\'s a stage, and all the men and women merely players. They have their exits and their entrances; And one man in his time plays many parts.', + text: 'HEADING\n\nAll the world\'s a stage, merely players. They have their exits and their entrances; And one man in his time plays many parts.', //text: 'HEADING\n\nThis is a really cool paragraph. \n And this is a footer.', fontSize: 24, fontFamily: 'Calibri', @@ -185,7 +185,7 @@ Test.Modules.Text = { //width: 20, width: 380, //width: 200, - padding: 0, + padding: 10, align: 'center', draggable: true, wrap: 'WORD'