From 9a798cc979cb94e22fe77cd4e41e22af69e9614c Mon Sep 17 00:00:00 2001 From: ClemensFischer Date: Wed, 28 Aug 2024 23:37:08 +0200 Subject: [PATCH] Update MapPanel.cs --- MapControl/Shared/MapPanel.cs | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/MapControl/Shared/MapPanel.cs b/MapControl/Shared/MapPanel.cs index a25ef0d7..aa8dfad1 100644 --- a/MapControl/Shared/MapPanel.cs +++ b/MapControl/Shared/MapPanel.cs @@ -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;