Defines the interface required for a rendering node to interact with the renderer and the SVG DOM
Exemplo n.º 1
0
 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);
     }
       }
 }
Exemplo n.º 2
0
        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);
            }
              }
        }