mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-03-28 16:15:12 +01:00
Update MapPanel.cs
This commit is contained in:
parent
ada677242a
commit
6a81d192b6
|
|
@ -173,35 +173,28 @@ namespace MapControl
|
|||
}
|
||||
}
|
||||
|
||||
try
|
||||
if (position.HasValue)
|
||||
{
|
||||
if (position.HasValue)
|
||||
ArrangeElement(element, position.Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
var boundingBox = GetBoundingBox(element);
|
||||
|
||||
if (boundingBox != null)
|
||||
{
|
||||
ArrangeElement(element, position.Value);
|
||||
var viewRect = GetViewRect(boundingBox);
|
||||
|
||||
if (viewRect != null)
|
||||
{
|
||||
ArrangeElement(element, viewRect);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var boundingBox = GetBoundingBox(element);
|
||||
|
||||
if (boundingBox != null)
|
||||
{
|
||||
var viewRect = GetViewRect(boundingBox);
|
||||
|
||||
if (viewRect != null)
|
||||
{
|
||||
ArrangeElement(element, viewRect);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ArrangeElement(element, finalSize);
|
||||
}
|
||||
ArrangeElement(element, finalSize);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.WriteLine($"MapPanel.ArrangeElement: {ex.Message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -372,7 +365,14 @@ namespace MapControl
|
|||
rect.Height = Math.Round(rect.Height);
|
||||
}
|
||||
|
||||
element.Arrange(rect);
|
||||
try
|
||||
{
|
||||
element.Arrange(rect);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.WriteLine($"MapPanel.ArrangeElement: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
private static void ParentMapPropertyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
|
||||
|
|
|
|||
Loading…
Reference in a new issue