mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-01-20 23:50:17 +01:00
Update MapPanel.cs
This commit is contained in:
parent
ae1baeb944
commit
9a798cc979
|
|
@ -295,6 +295,23 @@ namespace MapControl
|
|||
}
|
||||
}
|
||||
|
||||
private static void ArrangeElement(FrameworkElement element, ViewRect rect)
|
||||
{
|
||||
element.Width = rect.Rect.Width;
|
||||
element.Height = rect.Rect.Height;
|
||||
|
||||
element.Arrange(rect.Rect);
|
||||
|
||||
if (element.RenderTransform is RotateTransform rotateTransform)
|
||||
{
|
||||
rotateTransform.Angle = rect.Rotation;
|
||||
}
|
||||
else if (rect.Rotation != 0d)
|
||||
{
|
||||
SetRenderTransform(element, new RotateTransform { Angle = rect.Rotation }, 0.5, 0.5);
|
||||
}
|
||||
}
|
||||
|
||||
private static void ArrangeElement(FrameworkElement element, Point position)
|
||||
{
|
||||
var size = GetDesiredSize(element);
|
||||
|
|
@ -379,23 +396,6 @@ namespace MapControl
|
|||
element.Arrange(new Rect(x, y, width, height));
|
||||
}
|
||||
|
||||
private static void ArrangeElement(FrameworkElement element, ViewRect rect)
|
||||
{
|
||||
element.Width = rect.Rect.Width;
|
||||
element.Height = rect.Rect.Height;
|
||||
|
||||
element.Arrange(rect.Rect);
|
||||
|
||||
if (element.RenderTransform is RotateTransform rotateTransform)
|
||||
{
|
||||
rotateTransform.Angle = rect.Rotation;
|
||||
}
|
||||
else if (rect.Rotation != 0d)
|
||||
{
|
||||
SetRenderTransform(element, new RotateTransform { Angle = rect.Rotation }, 0.5, 0.5);
|
||||
}
|
||||
}
|
||||
|
||||
internal static Size GetDesiredSize(FrameworkElement element)
|
||||
{
|
||||
var width = element.DesiredSize.Width;
|
||||
|
|
|
|||
Loading…
Reference in a new issue