/// <summary>
        /// Sets the clipping region of the specified <see cref="RenderContext"/>.
        /// </summary>
        /// <param name="renderer">The <see cref="RenderContext"/> to have its clipping region set.</param>
        protected virtual void SetClip(RenderContext renderer)
        {
            Css.Value clip = ClipPath;

            if (clip == null)
            {
                return;
            }

            _previousClip = renderer.ClipRegion;

            // Get the shape from the clip value:
            Css.Value     nextValue;
            ShapeProvider shape = clip.ToShape(this, renderer, out nextValue);

            if (clip != nextValue)
            {
                // Overwrite the raw clip var:
                ClipPath = nextValue;
            }

            if (shape != null)
            {
                // Get the region now:
                renderer.SetClip(shape.GetRegion(this, renderer), false);
            }
        }
示例#2
0
 public SVGPathElement()
 {
     Shape = new ShapeProvider();
     Shape.SetPath(new VectorPath());
 }