From a1c74b8fd3720386ce1dd22f1d1e77b5ee8a3059 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Tue, 18 Mar 2014 11:20:50 +0100 Subject: [PATCH] Explicitly state raster resolution in unit tests. Since #rasterize() uses the HiDPI resolution if present now. --- test/tests/HitResult.js | 4 ++-- test/tests/Item.js | 4 ++-- test/tests/Item_Cloning.js | 2 +- test/tests/Raster.js | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test/tests/HitResult.js b/test/tests/HitResult.js index 91f53c67..45e254c5 100644 --- a/test/tests/HitResult.js +++ b/test/tests/HitResult.js @@ -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)); diff --git a/test/tests/Item.js b/test/tests/Item.js index e09699b3..9ce30b0f 100644 --- a/test/tests/Item.js +++ b/test/tests/Item.js @@ -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), diff --git a/test/tests/Item_Cloning.js b/test/tests/Item_Cloning.js index ab752c9b..d054cc8f 100644 --- a/test/tests/Item_Cloning.js +++ b/test/tests/Item_Cloning.js @@ -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; diff --git a/test/tests/Raster.js b/test/tests/Raster.js index 613cba70..f5519049 100644 --- a/test/tests/Raster.js +++ b/test/tests/Raster.js @@ -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);