Add failing test for setting a blend mode on an item in a transformed group.

This commit is contained in:
Jonathan Puckey 2013-03-16 15:44:04 +01:00
parent 2b7f526c62
commit 3f2fdbc710

View file

@ -622,4 +622,33 @@ test('Item#data', function() {
equals(item.data.testing, true, 'we can set data using an object literal constructor');
// TODO: add tests to see if importing and exporting of Item#data works
});
});
test('blendmode on an item in a transformed group', function() {
var layer = new Layer();
var path1 = new Path.Rectangle({
size: [100, 100],
fillColor: new RgbColor(1, 0, 0)
});
var path2 = new Path.Circle({
radius: 25,
center: [50, 50],
fillColor: new RgbColor(0, 1, 0),
blendMode: 'screen'
});
var raster = layer.rasterize();
compareRgbColors(raster.getPixel(0, 0), new RgbColor(1, 0, 0), 'Top left pixel');
compareRgbColors(raster.getPixel(50, 50), new RgbColor(1, 1, 0), 'Middle center pixel');
raster.remove();
path2.position = [0, 0];
var group = new Group(path2);
group.position = [50, 50];
var raster = layer.rasterize();
compareRgbColors(raster.getPixel(0, 0), new RgbColor(1, 0, 0), 'Top left pixel');
compareRgbColors(raster.getPixel(50, 50), new RgbColor(1, 1, 0), 'Middle center pixel');
});