Beispiel #1
0
        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;
        }
Beispiel #2
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);
         }
     }
 }
Beispiel #3
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);
                }
            }
        }
Beispiel #4
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);
     }
       }
 }
Beispiel #5
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);
            }
              }
        }
Beispiel #6
0
        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;
        }