/// <inheritdoc/>
        public override void ResetClip()
        {
            if (this.clipRect == null)
            {
                return;
            }

            this.clipRect = null;
            this.w.EndClip();
        }
        /// <summary>
        /// Draws the clipped rectangle as a polygon.
        /// </summary>
        /// <param name="rc">
        /// The render context.
        /// </param>
        /// <param name="rect">
        /// The rectangle to draw.
        /// </param>
        /// <param name="clippingRectangle">
        /// The clipping rectangle.
        /// </param>
        /// <param name="fill">
        /// The fill color.
        /// </param>
        /// <param name="stroke">
        /// The stroke color.
        /// </param>
        /// <param name="thickness">
        /// The stroke thickness.
        /// </param>
        public static void DrawClippedRectangleAsPolygon(
            this IRenderContext rc,
            OxyRect rect,
            OxyRect clippingRectangle,
            OxyColor fill,
            OxyColor stroke,
            double thickness)
        {
            OxyRect?clippedRect = ClipRect(rect, clippingRectangle);

            if (clippedRect == null)
            {
                return;
            }

            rc.DrawRectangleAsPolygon(clippedRect.Value, fill, stroke, thickness);
        }
        /// <inheritdoc/>
        public override bool SetClip(OxyRect rect)
        {
            if (this.clipRect != null)
            {
                if (rect.Equals(this.clipRect.Value))
                {
                    return(true);
                }
                else
                {
                    this.ResetClip();
                }
            }

            this.clipRect = rect;
            this.w.BeginClip(rect.Left, rect.Top, rect.Width, rect.Height);
            return(true);
        }
Beispiel #4
0
 /// <summary>
 /// Shows the zoom rectangle.
 /// </summary>
 /// <param name="rectangle">The rectangle.</param>
 public void ShowZoomRectangle(OxyRect rectangle)
 {
     this.zoomRectangle = rectangle;
     this.QueueDraw();
 }
Beispiel #5
0
 /// <summary>
 /// Hides the zoom rectangle.
 /// </summary>
 public void HideZoomRectangle()
 {
     this.zoomRectangle = null;
     this.QueueDraw();
 }
Beispiel #6
0
 /// <summary>
 /// Shows the zoom rectangle.
 /// </summary>
 /// <param name="rectangle">The rectangle.</param>
 public void ShowZoomRectangle(OxyRect rectangle)
 {
     this.zoomRectangle = rectangle;
     this.QueueDraw();
 }
Beispiel #7
0
 /// <summary>
 /// Hides the zoom rectangle.
 /// </summary>
 public void HideZoomRectangle()
 {
     this.zoomRectangle = null;
     this.QueueDraw();
 }
Beispiel #8
0
 /// <summary>
 /// Hides the zoom rectangle.
 /// </summary>
 public virtual void HideZoomRectangle()
 {
     zoomRectangle = null;
     QueueDraw();
 }
Beispiel #9
0
 /// <summary>
 /// Shows the zoom rectangle.
 /// </summary>
 /// <param name="rectangle">The rectangle.</param>
 public virtual void ShowZoomRectangle(OxyRect rectangle)
 {
     zoomRectangle = rectangle;
     QueueDraw();
 }
Beispiel #10
0
 /// <summary>
 /// Shows the zoom rectangle.
 /// </summary>
 /// <param name="rectangle">The rectangle.</param>
 public virtual void ShowZoomRectangle(OxyRect rectangle)
 {
     zoomRectangle = rectangle;
     QueueDraw();
 }
Beispiel #11
0
 /// <summary>
 /// Hides the zoom rectangle.
 /// </summary>
 public virtual void HideZoomRectangle()
 {
     zoomRectangle = null;
     QueueDraw();
 }