Commit d6e261b9 authored by tebjan's avatar tebjan
Browse files

remove uses depth first recursion for children

parent 1758a5b5
No related merge requests found
Showing with 14 additions and 1 deletion
+14 -1
......@@ -156,7 +156,7 @@ namespace Svg
if (this._owner.OwnerDocument != null)
{
item.ApplyRecursive(this._owner.OwnerDocument.IdManager.Remove);
item.ApplyRecursiveDepthFirst(this._owner.OwnerDocument.IdManager.Remove);
}
}
}
......
......@@ -81,5 +81,18 @@ namespace Svg
}
}
}
public static void ApplyRecursiveDepthFirst(this SvgElement elem, Action<SvgElement> action)
{
if(!(elem is SvgDocument)) //don't apply action to subtree of documents
{
foreach (var element in elem.Children)
{
element.ApplyRecursiveDepthFirst(action);
}
}
action(elem);
}
}
}
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