mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-07 23:45:05 +00:00
Update map grids
This commit is contained in:
parent
80252cbfd0
commit
a7e7442d44
6 changed files with 113 additions and 52 deletions
|
|
@ -96,8 +96,21 @@ namespace MapControl
|
|||
textBlock.Text = label.Text;
|
||||
textBlock.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
|
||||
|
||||
var x = label.HorizontalAlignment switch
|
||||
{
|
||||
HorizontalAlignment.Left => 2d,
|
||||
HorizontalAlignment.Right => -textBlock.DesiredSize.Width - 2d,
|
||||
_ => -textBlock.DesiredSize.Width / 2d
|
||||
};
|
||||
var y = label.VerticalAlignment switch
|
||||
{
|
||||
VerticalAlignment.Top => 0d,
|
||||
VerticalAlignment.Bottom => -textBlock.DesiredSize.Height,
|
||||
_ => -textBlock.DesiredSize.Height / 2d,
|
||||
};
|
||||
|
||||
var matrix = new Matrix(1, 0, 0, 1, 0, 0);
|
||||
matrix.Translate(StrokeThickness / 2d + 2d, -textBlock.DesiredSize.Height / 2d);
|
||||
matrix.Translate(x, y);
|
||||
matrix.Rotate(label.Rotation);
|
||||
matrix.Translate(label.X, label.Y);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue