Пример #1
0
        /// <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());
 }