2017-06-25 23:05:48 +02:00
|
|
|
|
// XAML Map Control - https://github.com/ClemensFischer/XAML-Map-Control
|
2019-03-27 18:39:59 +01:00
|
|
|
|
// © 2019 Clemens Fischer
|
2017-06-25 23:05:48 +02:00
|
|
|
|
// Licensed under the Microsoft Public License (Ms-PL)
|
|
|
|
|
|
|
2018-12-20 21:55:12 +01:00
|
|
|
|
using System;
|
|
|
|
|
|
|
2017-06-25 23:05:48 +02:00
|
|
|
|
namespace MapControl
|
|
|
|
|
|
{
|
|
|
|
|
|
public class CenteredBoundingBox : BoundingBox
|
|
|
|
|
|
{
|
|
|
|
|
|
private readonly double width;
|
|
|
|
|
|
private readonly double height;
|
|
|
|
|
|
|
|
|
|
|
|
public CenteredBoundingBox(Location center, double width, double height)
|
|
|
|
|
|
{
|
2018-12-04 00:38:54 +01:00
|
|
|
|
Center = center;
|
2018-12-20 21:55:12 +01:00
|
|
|
|
this.width = Math.Max(width, 0d);
|
|
|
|
|
|
this.height = Math.Max(height, 0d);
|
2017-06-25 23:05:48 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
2018-12-04 00:38:54 +01:00
|
|
|
|
public Location Center { get; private set; }
|
2017-06-25 23:05:48 +02:00
|
|
|
|
|
|
|
|
|
|
public override double Width
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return width; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override double Height
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return height; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override BoundingBox Clone()
|
|
|
|
|
|
{
|
2018-12-04 00:38:54 +01:00
|
|
|
|
return new CenteredBoundingBox(Center, Width, Height);
|
2017-06-25 23:05:48 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|