XAML-Map-Control/MapControl/Shared/CenteredBoundingBox.cs

28 lines
772 B
C#
Raw Normal View History

// XAML Map Control - https://github.com/ClemensFischer/XAML-Map-Control
2022-01-14 20:22:56 +01:00
// © 2022 Clemens Fischer
// Licensed under the Microsoft Public License (Ms-PL)
2018-12-20 21:55:12 +01:00
using System;
namespace MapControl
{
public class CenteredBoundingBox : BoundingBox
{
2022-12-07 22:29:08 +01:00
private readonly Location center;
private readonly double width;
private readonly double height;
public CenteredBoundingBox(Location c, double w, double h)
{
2022-12-07 22:29:08 +01:00
center = c;
width = Math.Max(w, 0d);
height = Math.Max(h, 0d);
}
2022-12-08 15:05:19 +01:00
public override bool HasValidBounds => false;
2022-12-07 22:29:08 +01:00
public override Location Center => center;
public override double Width => width;
public override double Height => height;
}
}