public ISvgMatrix GetTransformToElement(ISvgElement element) { ISvgLocatable loc = element as ISvgLocatable; ISvgMatrix ctm = loc.GetCTM(); ISvgMatrix vctm; XmlNode node = element.ParentNode; while (node != null && node != OwnerDocument) { if (string.Equals(node.Name, "svg", StringComparison.Ordinal)) { vctm = ((SvgSvgElement)node).ViewBoxTransform; ctm = vctm.Multiply(ctm); } else { loc = node as ISvgLocatable; ctm = loc.GetCTM().Multiply(ctm); } node = node.ParentNode; } return(ctm); }
public ISvgMatrix GetTransformToElement(ISvgElement element) { ISvgLocatable loc = element as ISvgLocatable; ISvgMatrix ctm = loc.GetCTM(); ISvgMatrix vctm; XmlNode node = element.ParentNode; while (node != null && node != OwnerDocument) { if (node.Name == "svg") { vctm = (node as SvgSvgElement).ViewBoxTransform; ctm = vctm.Multiply(ctm); } else { loc = node as ISvgLocatable; ctm = loc.GetCTM().Multiply(ctm); } node = node.ParentNode; } return(ctm); }