mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-05 06:26:41 +00:00
Improve Data handling in WPF MapPath
This commit is contained in:
parent
2652e5eb0f
commit
65c93d1a3e
2 changed files with 30 additions and 19 deletions
|
|
@ -68,23 +68,22 @@ namespace MapControl
|
|||
|
||||
protected virtual void UpdateData()
|
||||
{
|
||||
#if !WINUI && !UWP
|
||||
if (Data != null && Data.IsFrozen)
|
||||
{
|
||||
Data = Data.Clone();
|
||||
return; // UpdateData called again from DataPropertyChanged callback
|
||||
}
|
||||
#endif
|
||||
MapPanel.SetLocation(this, Location);
|
||||
|
||||
if (parentMap != null && Location != null && Data != null)
|
||||
{
|
||||
var scale = parentMap.GetScale(Location);
|
||||
var transform = new Matrix(scale.X, 0d, 0d, scale.Y, 0d, 0d);
|
||||
var matrix = new Matrix(scale.X, 0d, 0d, scale.Y, 0d, 0d);
|
||||
matrix.Rotate(parentMap.ViewTransform.Rotation);
|
||||
|
||||
transform.Rotate(parentMap.ViewTransform.Rotation);
|
||||
|
||||
Data.Transform = new MatrixTransform { Matrix = transform };
|
||||
if (Data.Transform is MatrixTransform transform)
|
||||
{
|
||||
transform.Matrix = matrix;
|
||||
}
|
||||
else
|
||||
{
|
||||
Data.Transform = new MatrixTransform { Matrix = matrix };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue