mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-01-02 14:50:06 +01:00
Update MapPanel.cs
This commit is contained in:
parent
6a14d740e8
commit
535161c5a3
|
|
@ -3,7 +3,9 @@
|
|||
// Licensed under the Microsoft Public License (Ms-PL)
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Security.Policy;
|
||||
#if WINUI
|
||||
using Windows.Foundation;
|
||||
using Microsoft.UI.Xaml;
|
||||
|
|
@ -219,23 +221,30 @@ namespace MapControl
|
|||
}
|
||||
}
|
||||
|
||||
if (position.HasValue)
|
||||
try
|
||||
{
|
||||
ArrangeElement(element, position.Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
var boundingBox = GetBoundingBox(element);
|
||||
|
||||
if (boundingBox != null)
|
||||
if (position.HasValue)
|
||||
{
|
||||
ArrangeElement(element, GetViewRect(boundingBox));
|
||||
ArrangeElement(element, position.Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
ArrangeElement(element, finalSize);
|
||||
var boundingBox = GetBoundingBox(element);
|
||||
|
||||
if (boundingBox != null)
|
||||
{
|
||||
ArrangeElement(element, GetViewRect(boundingBox));
|
||||
}
|
||||
else
|
||||
{
|
||||
ArrangeElement(element, finalSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.WriteLine($"MapPanel.ArrangeElement: {ex.Message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue