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
|
|
@ -74,8 +74,20 @@ namespace MapControl
|
|||
{
|
||||
var text = new FormattedText(label.Text,
|
||||
CultureInfo.InvariantCulture, FlowDirection.LeftToRight, typeface, FontSize, Foreground, pixelsPerDip);
|
||||
var x = label.X + StrokeThickness / 2d + 2d;
|
||||
var y = label.Y - text.Height / 2d;
|
||||
var x = label.X +
|
||||
label.HorizontalAlignment switch
|
||||
{
|
||||
HorizontalAlignment.Left => 2d,
|
||||
HorizontalAlignment.Right => -text.Width - 2d,
|
||||
_ => -text.Width / 2d
|
||||
};
|
||||
var y = label.Y +
|
||||
label.VerticalAlignment switch
|
||||
{
|
||||
VerticalAlignment.Top => 0,
|
||||
VerticalAlignment.Bottom => -text.Height,
|
||||
_ => -text.Height / 2d
|
||||
};
|
||||
|
||||
if (label.Rotation != 0d)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue