mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -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)
|
fillColor: new Color(1, 0, 0)
|
||||||
});
|
});
|
||||||
var raster = paper.project.activeLayer.rasterize(72);
|
var raster = paper.project.activeLayer.rasterize(72);
|
||||||
circle.scale(0.9);
|
circle.scale(0.8);
|
||||||
equals(raster.getAverageColor(circle), circle.fillColor);
|
equals(raster.getAverageColor(circle), circle.fillColor, null,
|
||||||
|
{ tolerance: 10e-4 });
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Raster#getAverageColor(path) with compound path', function() {
|
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);
|
var compoundPath = new CompoundPath(path, path2);
|
||||||
compoundPath.fillColor = new Color(1, 0, 0);
|
compoundPath.fillColor = new Color(1, 0, 0);
|
||||||
var raster = paper.project.activeLayer.rasterize(72);
|
var raster = paper.project.activeLayer.rasterize(72);
|
||||||
path.scale(0.9);
|
path.scale(0.8);
|
||||||
path2.scale(1.1);
|
path2.scale(1.2);
|
||||||
equals(raster.getAverageColor(compoundPath), new Color(1, 0, 0), null, { tolerance: 10e-4 });
|
equals(raster.getAverageColor(compoundPath), new Color(1, 0, 0), null,
|
||||||
|
{ tolerance: 10e-4 });
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue