Explicitly state raster resolution in unit tests.

Since #rasterize() uses the HiDPI resolution if present now.
This commit is contained in:
Jürg Lehni 2014-03-18 11:20:50 +01:00
parent dfac101bfc
commit a1c74b8fd3
4 changed files with 7 additions and 7 deletions

View file

@ -380,7 +380,7 @@ test('hitting raster bounding box', function() {
radius: 50,
fillColor: 'red'
});
var raster = path.rasterize();
var raster = path.rasterize(72);
path.remove();
var hitResult = paper.project.hitTest(raster.bounds.topLeft, {
@ -432,7 +432,7 @@ test('hitting raster items', function() {
// Create a path, rasterize it and then remove the path:
var path = new Path.Rectangle(new Point(), new Size(320, 240));
path.fillColor = 'red';
var raster = path.rasterize();
var raster = path.rasterize(72);
var hitResult = paper.project.hitTest(new Point(160, 120));

View file

@ -646,7 +646,7 @@ test('Item#blendMode in a transformed Group', function() {
blendMode: 'screen'
});
var raster = layer.rasterize();
var raster = layer.rasterize(72);
compareColors(raster.getPixel(0, 0), new Color(1, 0, 0, 1),
'Top left pixel should be red:');
compareColors(raster.getPixel(50, 50), new Color(1, 1, 0, 1),
@ -658,7 +658,7 @@ test('Item#blendMode in a transformed Group', function() {
var group = new Group(path2);
group.position = [50, 50];
var raster = layer.rasterize();
var raster = layer.rasterize(72);
compareColors(raster.getPixel(0, 0), new Color(1, 0, 0, 1),
'Top left pixel should be red:');
compareColors(raster.getPixel(50, 50), new Color(1, 1, 0, 1),

View file

@ -149,7 +149,7 @@ test('Raster#clone()', function() {
fillColor: new Color(0, 0, 1),
strokeColor: new Color(0, 0, 1)
};
var raster = path.rasterize();
var raster = path.rasterize(72);
raster.opacity = 0.5;
raster.locked = true;
raster.visible = false;

View file

@ -129,7 +129,7 @@ test('Raster#getAverageColor(path)', function() {
radius: 25,
fillColor: new Color(1, 0, 0)
});
var raster = paper.project.activeLayer.rasterize();
var raster = paper.project.activeLayer.rasterize(72);
circle.scale(0.9);
compareColors(raster.getAverageColor(circle), circle.fillColor, null, 3);
});
@ -150,7 +150,7 @@ test('Raster#getAverageColor(path) with compound path', function() {
});
var compoundPath = new CompoundPath(path, path2);
compoundPath.fillColor = new Color(1, 0, 0);
var raster = paper.project.activeLayer.rasterize();
var raster = paper.project.activeLayer.rasterize(72);
path.scale(0.9);
path2.scale(1.1);
compareColors(raster.getAverageColor(compoundPath), new Color(1, 0, 0), null, 3);