public override void CacheRenderingRegion(ISvgRenderer renderer) { SvgTransformableElement refEl = ReferencedElement as SvgTransformableElement; if (refEl == null) { return; } if (renderingNode == null) { renderingNode = renderer.GetRenderingNode(this); } // Check if it has already been calculated if (renderingNode != null && renderingNode.ScreenRegion != RectangleF.Empty) { return; } XmlElement refElParent = (XmlElement)refEl.ParentNode; OwnerDocument.Static = true; CopyToReferencedElement(refEl); refElParent.RemoveChild(refEl); this.AppendChild(refEl); refEl.CacheRenderingRegion(renderer); renderingNode.ScreenRegion = refEl.RenderingNode.ScreenRegion; this.RemoveChild(refEl); RestoreReferencedElement(refEl); refElParent.AppendChild(refEl); OwnerDocument.Static = false; }
public virtual void Render(ISvgRenderer renderer) { if (!(this is ISharpDoNotPaint) || (this is SvgSymbolElement && this.ParentNode is SvgUseElement)) { if (renderingNode == null) { renderingNode = renderer.GetRenderingNode(this); } if (renderingNode != null) { if (!renderingNode.NeedRender(renderer)) { return; } renderingNode.BeforeRender(renderer); renderingNode.Render(renderer); RenderChildren(renderer); renderingNode.AfterRender(renderer); } } }
public virtual void CacheRenderingRegion(ISvgRenderer renderer) { if (renderingNode == null) { renderingNode = renderer.GetRenderingNode(this); } // Check if it has already been calculated if (renderingNode != null && renderingNode.ScreenRegion != RectangleF.Empty) { return; } // Invalidate the children foreach (XmlNode node in ChildNodes) { SvgElement element = node as SvgElement; if (element != null) { element.CacheRenderingRegion(renderer); } } }
public virtual void Render(ISvgRenderer renderer) { if ( !(this is ISharpDoNotPaint) || (this is SvgSymbolElement && this.ParentNode is SvgUseElement)) { if (renderingNode == null) { renderingNode = renderer.GetRenderingNode(this); } if (renderingNode != null) { if (!renderingNode.NeedRender(renderer)) return; renderingNode.BeforeRender(renderer); renderingNode.Render(renderer); RenderChildren(renderer); renderingNode.AfterRender(renderer); } } }
public virtual void CacheRenderingRegion(ISvgRenderer renderer) { if(renderingNode == null) { renderingNode = renderer.GetRenderingNode(this); } // Check if it has already been calculated if (renderingNode != null && renderingNode.ScreenRegion != RectangleF.Empty) return; // Invalidate the children foreach (XmlNode node in ChildNodes ) { SvgElement element = node as SvgElement; if (element != null) { element.CacheRenderingRegion(renderer); } } }
public override void CacheRenderingRegion(ISvgRenderer renderer) { SvgTransformableElement refEl = ReferencedElement as SvgTransformableElement; if (refEl == null) return; if(renderingNode == null) { renderingNode = renderer.GetRenderingNode(this); } // Check if it has already been calculated if (renderingNode != null && renderingNode.ScreenRegion != RectangleF.Empty) return; XmlElement refElParent = (XmlElement)refEl.ParentNode; OwnerDocument.Static = true; CopyToReferencedElement(refEl); refElParent.RemoveChild(refEl); this.AppendChild(refEl); refEl.CacheRenderingRegion(renderer); renderingNode.ScreenRegion = refEl.RenderingNode.ScreenRegion; this.RemoveChild(refEl); RestoreReferencedElement(refEl); refElParent.AppendChild(refEl); OwnerDocument.Static = false; }