From 5f42020869462b3346fb2ccbae8908c4d242a24b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Mon, 27 Jul 2015 10:03:11 +0200 Subject: [PATCH] Increase tolerances in #getAverageColor() tests. The phantomjs canvas appear to produce less precise results. --- test/tests/Raster.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/test/tests/Raster.js b/test/tests/Raster.js index cdcf1012..beb51d5a 100644 --- a/test/tests/Raster.js +++ b/test/tests/Raster.js @@ -130,8 +130,9 @@ test('Raster#getAverageColor(path)', function() { fillColor: new Color(1, 0, 0) }); var raster = paper.project.activeLayer.rasterize(72); - circle.scale(0.9); - equals(raster.getAverageColor(circle), circle.fillColor); + circle.scale(0.8); + equals(raster.getAverageColor(circle), circle.fillColor, null, + { tolerance: 10e-4 }); }); test('Raster#getAverageColor(path) with compound path', function() { @@ -151,7 +152,8 @@ 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(72); - path.scale(0.9); - path2.scale(1.1); - equals(raster.getAverageColor(compoundPath), new Color(1, 0, 0), null, { tolerance: 10e-4 }); + path.scale(0.8); + path2.scale(1.2); + equals(raster.getAverageColor(compoundPath), new Color(1, 0, 0), null, + { tolerance: 10e-4 }); });