Skip to content

Commit

Permalink
Fixed the PenLineCap property.
Browse files Browse the repository at this point in the history
  • Loading branch information
m0lDaViA committed May 1, 2024
1 parent 5525c2b commit a35eb01
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/Wpf.Ui/Controls/Arc/Arc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Point = System.Windows.Point;
using Size = System.Windows.Size;
#pragma warning disable SA1124
#pragma warning disable CS0108

namespace Wpf.Ui.Controls;

Expand Down Expand Up @@ -47,7 +48,7 @@ public class Arc : Shape
);

/// <summary>Identifies the <see cref="StrokeStartLineCap"/> dependency property.</summary>
public static new readonly DependencyProperty StrokeStartLineCapProperty =
public static readonly DependencyProperty StrokeStartLineCapProperty =
DependencyProperty.Register(
nameof(StrokeStartLineCap),
typeof(PenLineCap),
Expand Down Expand Up @@ -86,7 +87,7 @@ public SweepDirection SweepDirection
set => SetValue(SweepDirectionProperty, value);
}

public new PenLineCap StrokeStartLineCap
public PenLineCap StrokeStartLineCap
{
get { return (PenLineCap)GetValue(StrokeStartLineCapProperty); }
set { SetValue(StrokeStartLineCapProperty, value); }
Expand Down Expand Up @@ -235,7 +236,13 @@ protected override Size ArrangeOverride(Size finalSize)
protected override void OnRender(DrawingContext drawingContext)
{
base.OnRender(drawingContext);
drawingContext.DrawGeometry(Stroke, new Pen(Stroke, StrokeThickness), DefinedGeometry());
Pen pen = new(Stroke, StrokeThickness)
{
StartLineCap = StrokeStartLineCap,
EndLineCap = StrokeStartLineCap
};

drawingContext.DrawGeometry(Stroke, pen, DefinedGeometry());
}

#endregion
Expand Down

0 comments on commit a35eb01

Please sign in to comment.