Fixed MapPath rendering

This commit is contained in:
ClemensFischer 2023-01-24 16:22:02 +01:00
parent 1ac9ee6b82
commit 29ffdc4420
5 changed files with 40 additions and 9 deletions

View file

@ -14,6 +14,11 @@ namespace MapControl
{
public partial class MapPath : Shape, IWeakEventListener
{
public MapPath()
{
Stretch = Stretch.None;
}
public static readonly DependencyProperty DataProperty = Path.DataProperty.AddOwner(
typeof(MapPath), new PropertyMetadata(null, DataPropertyChanged));
@ -25,11 +30,6 @@ namespace MapControl
protected override Geometry DefiningGeometry => Data;
protected override Geometry GetLayoutClip(Size layoutSlotSize)
{
return ClipToBounds ? base.GetLayoutClip(layoutSlotSize) : null;
}
private static void DataPropertyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
{
// Check if Data is actually a new Geometry.
@ -98,7 +98,7 @@ namespace MapControl
{
StartPoint = points.First(),
IsClosed = closed,
IsFilled = closed
IsFilled = true
};
figure.Segments.Add(new PolyLineSegment(points.Skip(1), true));