Example #1
0
        public override void DrawGeometry(Brush brush, Pen pen, Geometry geometry, Avalonia.Media.Matrix transform)
        {
            Direct2D1StreamGeometry platformGeometry = (Direct2D1StreamGeometry)geometry.PlatformImpl;

            using (TransformedGeometry d2dGeometry = new TransformedGeometry(
                       this.factory,
                       platformGeometry.Direct2DGeometry,
                       transform.ToSharpDX()))
            {
                if (brush != null)
                {
                    this.target.FillGeometry(d2dGeometry, brush.ToSharpDX(this.target));
                }

                if (pen != null)
                {
                    this.target.DrawGeometry(
                        d2dGeometry,
                        pen.Brush.ToSharpDX(this.target),
                        (float)pen.Thickness);
                }
            }
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="TransformedBounds"/> struct.
 /// </summary>
 /// <param name="bounds">The control's bounds.</param>
 /// <param name="clip">The control's clip rectangle.</param>
 /// <param name="transform">The control's transform.</param>
 public TransformedBounds(Rect bounds, Rect clip, Matrix transform)
 {
     Bounds = bounds;
     Clip = clip;
     Transform = transform;
 }