/// <summary>Adds all child paths together.</summary> protected void AddChildPaths(Node parent, VectorPath bakeInto, RenderContext renderer, Matrix4x4 extraTransform, bool applyExtra) { if (parent.childNodes_ == null) { return; } foreach (Node child in parent.childNodes_) { SVGGeometryElement pathBase = child as SVGGeometryElement; // Got a path? if (pathBase != null) { // Yep! Get the path itself: VectorPath path = pathBase.GetPath(pathBase, renderer); if (path != null) { // Copy it: path = path.CopyPath(); // Push transform: pathBase.PushTransforms(renderer); // Get the resolved matrix: Matrix4x4 transform = renderer.Transform.Matrix; // Apply extra transform: if (applyExtra) { transform *= extraTransform; } // Pop it again: pathBase.PopTransforms(renderer); // Transform the path: path.Transform(transform); // Add into bakeInto: bakeInto.Append(path); } } // Apply to this child too: AddChildPaths(child, bakeInto, renderer, extraTransform, applyExtra); } }