Unverified Commit 64b5c21a authored by mrbean-bremen's avatar mrbean-bremen
Browse files

Fixed regression caused by use test for recursion

- added image broken by regression to tests (__Flag_of_the_United_States)
- added some passing issue specific tests to image comparison tests
parent 34257c7d
...@@ -16,7 +16,7 @@ namespace Svg ...@@ -16,7 +16,7 @@ namespace Svg
set { this._referencedElement = value; } set { this._referencedElement = value; }
} }
static private bool ElementReferencesUri(SvgElement element, List<Uri> elementUris) private bool ElementReferencesUri(SvgElement element, List<Uri> elementUris)
{ {
var useElement = element as SvgUse; var useElement = element as SvgUse;
if (useElement != null) if (useElement != null)
...@@ -26,7 +26,11 @@ namespace Svg ...@@ -26,7 +26,11 @@ namespace Svg
return true; return true;
} }
// also detect cycles in referenced elements // also detect cycles in referenced elements
elementUris.Add(useElement.ReferencedElement); var refElement = this.OwnerDocument.IdManager.GetElementById(useElement.ReferencedElement);
if (refElement is SvgUse)
{
elementUris.Add(useElement.ReferencedElement);
}
return useElement.ReferencedElementReferencesUri(elementUris); return useElement.ReferencedElementReferencesUri(elementUris);
} }
var groupElement = element as SvgGroup; var groupElement = element as SvgGroup;
......
...@@ -86,9 +86,16 @@ namespace Svg.UnitTests ...@@ -86,9 +86,16 @@ namespace Svg.UnitTests
try try
{ {
doc = SvgDocument.Open(svgPath); doc = SvgDocument.Open(svgPath);
var img = new Bitmap(480, 360); if (fileName.StartsWith("__"))
doc.Draw(img); {
svgImage = img; svgImage = doc.Draw();
}
else
{
var img = new Bitmap(480, 360);
doc.Draw(img);
svgImage = img;
}
} }
catch (Exception) catch (Exception)
{ {
......
...@@ -157,3 +157,11 @@ text-text-11-t ...@@ -157,3 +157,11 @@ text-text-11-t
text-tref-01-b text-tref-01-b
text-tspan-01-b text-tspan-01-b
types-basic-01-f types-basic-01-f
__Flag_of_the_United_States
__issue-064-02
__issue-279-01
__issueViewBox
__pull_request-373-01
__pull_request-374-01
__Telefunken_FuBK_test_pattern
__title
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment