mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-05 14:37:01 +00:00
Replaced RenderSize by ActualWidth/Height
This commit is contained in:
parent
4e6d0db24f
commit
fa508f51e7
16 changed files with 67 additions and 51 deletions
|
|
@ -2,6 +2,7 @@
|
|||
// Copyright © 2024 Clemens Fischer
|
||||
// Licensed under the Microsoft Public License (Ms-PL)
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
|
|
@ -78,9 +79,15 @@ namespace MapControl
|
|||
|
||||
if (points.Any())
|
||||
{
|
||||
var startPoint = points.First();
|
||||
var minX = startPoint.X;
|
||||
var maxX = startPoint.X;
|
||||
var minY = startPoint.Y;
|
||||
var maxY = startPoint.Y;
|
||||
|
||||
var figure = new PathFigure
|
||||
{
|
||||
StartPoint = points.First(),
|
||||
StartPoint = startPoint,
|
||||
IsClosed = closed,
|
||||
IsFilled = true
|
||||
};
|
||||
|
|
@ -89,10 +96,19 @@ namespace MapControl
|
|||
|
||||
foreach (var point in points.Skip(1))
|
||||
{
|
||||
minX = Math.Min(minX, point.X);
|
||||
maxX = Math.Max(maxX, point.X);
|
||||
minY = Math.Min(minY, point.Y);
|
||||
maxY = Math.Max(maxY, point.Y);
|
||||
polyline.Points.Add(point);
|
||||
}
|
||||
|
||||
figure.Segments.Add(polyline);
|
||||
if (maxX >= 0 && minX <= ParentMap.ActualWidth &&
|
||||
maxY >= 0 && minY <= ParentMap.ActualHeight)
|
||||
{
|
||||
figure.Segments.Add(polyline);
|
||||
}
|
||||
|
||||
pathFigures.Add(figure);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue