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
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;
if (useElement != null)
......@@ -26,7 +26,11 @@ namespace Svg
return true;
}
// 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);
}
var groupElement = element as SvgGroup;
......
......@@ -86,9 +86,16 @@ namespace Svg.UnitTests
try
{
doc = SvgDocument.Open(svgPath);
var img = new Bitmap(480, 360);
doc.Draw(img);
svgImage = img;
if (fileName.StartsWith("__"))
{
svgImage = doc.Draw();
}
else
{
var img = new Bitmap(480, 360);
doc.Draw(img);
svgImage = img;
}
}
catch (Exception)
{
......
......@@ -157,3 +157,11 @@ text-text-11-t
text-tref-01-b
text-tspan-01-b
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