renamed the Crop filter to Mask

This commit is contained in:
Eric Rowell
2013-04-04 22:22:28 -07:00
parent 171b2a57d3
commit 2cb39f087c
4 changed files with 8 additions and 8 deletions

View File

@@ -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"

View File

@@ -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) {

View File

@@ -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';

View File

@@ -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'