mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2024-12-29 09:22:22 -05:00
Increase tolerances in #getAverageColor() tests.
The phantomjs canvas appear to produce less precise results.
This commit is contained in:
parent
59b7da0ed5
commit
5f42020869
1 changed files with 7 additions and 5 deletions
|
@ -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 });
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue