Skip to content

Commit

Permalink
Added a test for #42
Browse files Browse the repository at this point in the history
  • Loading branch information
mattleibow committed Oct 25, 2018
1 parent ab899c2 commit e34d214
Show file tree
Hide file tree
Showing 2 changed files with 1,654 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,17 @@ public void SvgCanReadFileWithDTD()
Assert.Equal(SKColors.Black, bmp.GetPixel(50, 50));
}

[Fact]
public void SvgFillsAndStrokeHaveProperInheritance()
{
var path = Path.Combine(PathToImages, "issues-42.svg");
var bmp = LoadSvgBitmap(path, SKColors.Red);

Assert.Equal(SKColors.Black, bmp.GetPixel(47, 98));
Assert.Equal(SKColors.Black, bmp.GetPixel(149, 145));
Assert.Equal(SKColors.White, bmp.GetPixel(166, 246));
}

private static SKBitmap LoadSvgBitmap(string svgPath, SKColor? background = null)
{
// open the SVG
Expand Down
Loading

0 comments on commit e34d214

Please sign in to comment.