Source/OxyPlot.Avalonia/CanvasRenderContext.cs
/// <summary>
/// Sets the stroke properties of the specified shape object.
/// </summary>
/// <param name="shape">The shape.</param>
/// <param name="stroke">The stroke color.</param>
/// <param name="thickness">The thickness.</param>
/// <param name="lineJoin">The line join.</param>
/// <param name="dashArray">The dash array. Use <c>null</c> to get a solid line.</param>
/// <param name="dashOffset">The dash offset.</param>
/// <param name="aliased">The aliased.</param>
Sets the stroke properties of the specified shape object.
Sets the stroke properties of the specified shape object .
private void SetStroke(
            Shape shape,
            OxyColor stroke,
            double thickness,
            LineJoin lineJoin = LineJoin.Miter,
            IEnumerable<double> dashArray = null,
            double dashOffset = 0,
            bool aliased = false)
        {
            if (!stroke.IsUndefined() && thickness > 0)
            {
                shape.Stroke = GetCachedBrush(stroke);
                switch (lineJoin)
                {
                    case LineJoin.Round:
                        shape.StrokeJoin = PenLineJoin.Round;
                        break;
                    case LineJoin.Bevel:
                        shape.StrokeJoin = PenLineJoin.Bevel;
                        break;
                }
                if (thickness > 0)
                {
                    shape.StrokeThickness = thickness;
                }
                if (dashArray != null)
                {
                    shape.StrokeDashArray = new global::Avalonia.Collections.AvaloniaList<double>(dashArray);
                    shape.StrokeDashOffset = dashOffset;
                }
            }
        }
private void SetStroke ( Shape shape , OxyColor stroke , double thickness , LineJoin lineJoin = LineJoin . Miter , IEnumerable < double > dashArray = null , double dashOffset = 0 , bool aliased = false ) { if ( ! stroke . IsUndefined ( ) && thickness > 0 ) { shape . Stroke = GetCachedBrush ( stroke ) ; switch ( lineJoin ) { case LineJoin . Round : shape . StrokeJoin = PenLineJoin . Round ; break ; case LineJoin . Bevel : shape . StrokeJoin = PenLineJoin . Bevel ; break ; } if ( thickness > 0 ) { shape . StrokeThickness = thickness ; } if ( dashArray != null ) { shape . StrokeDashArray = new global :: Avalonia . Collections . AvaloniaList < double > ( dashArray ) ; shape . StrokeDashOffset = dashOffset ; } } }
Sets the stroke properties of the specified shape object.
Sets the stroke properties of the specified shape object .
// The default StrokeLineJoin is Miter
shape
Shape
None
stroke
OxyColor
The stroke color.
The stroke color .
thickness
double
None
lineJoin
LineJoin
The line join.
The line join .
dashArray
IEnumerable<double>
The dash array. Use null
The dash array . Use null
dashOffset
double
The dash offset.
The dash offset .
aliased
bool
None