From 8610f778994f455934434d47d369a4263903ef54 Mon Sep 17 00:00:00 2001 From: ClemensF Date: Fri, 3 Apr 2020 16:46:22 +0200 Subject: [PATCH] Minor updates --- MapControl/Shared/MapPanel.cs | 7 +++---- MapControl/Shared/MapPath.cs | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/MapControl/Shared/MapPanel.cs b/MapControl/Shared/MapPanel.cs index ca335af4..c554759e 100644 --- a/MapControl/Shared/MapPanel.cs +++ b/MapControl/Shared/MapPanel.cs @@ -229,15 +229,14 @@ namespace MapControl element.Arrange(rect); var rotateTransform = element.RenderTransform as RotateTransform; - var rotation = parentMap.ViewTransform.Rotation; if (rotateTransform != null) { - rotateTransform.Angle = rotation; + rotateTransform.Angle = parentMap.ViewTransform.Rotation; } - else if (rotation != 0d) + else if (parentMap.ViewTransform.Rotation != 0d) { - rotateTransform = new RotateTransform { Angle = rotation }; + rotateTransform = new RotateTransform { Angle = parentMap.ViewTransform.Rotation }; element.RenderTransform = rotateTransform; element.RenderTransformOrigin = new Point(0.5, 0.5); } diff --git a/MapControl/Shared/MapPath.cs b/MapControl/Shared/MapPath.cs index 4a311cde..3038f76a 100644 --- a/MapControl/Shared/MapPath.cs +++ b/MapControl/Shared/MapPath.cs @@ -100,7 +100,7 @@ namespace MapControl var viewPos = LocationToView(Location); var scale = parentMap.GetScale(Location); var transform = new Matrix(scale.X, 0d, 0d, scale.Y, 0d, 0d); - transform.Rotate(parentMap.Heading); + transform.Rotate(parentMap.ViewTransform.Rotation); transform.Translate(viewPos.X, viewPos.Y); dataTransform.Matrix = transform; }