mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
Update Rect.WinUI.cs
This commit is contained in:
parent
7df36512b8
commit
f143bdb5e6
|
|
@ -2,6 +2,8 @@
|
|||
// Copyright © 2024 Clemens Fischer
|
||||
// Licensed under the Microsoft Public License (Ms-PL)
|
||||
|
||||
using System;
|
||||
|
||||
namespace MapControl
|
||||
{
|
||||
/// <summary>
|
||||
|
|
@ -17,10 +19,12 @@ namespace MapControl
|
|||
Height = height;
|
||||
}
|
||||
|
||||
|
||||
public Rect(Point p1, Point p2)
|
||||
: this(p1.X, p1.Y, p2.X - p1.X, p2.Y - p1.Y)
|
||||
{
|
||||
X = Math.Min(p1.X, p2.X);
|
||||
Y = Math.Min(p1.Y, p2.Y);
|
||||
Width = Math.Max(p1.X, p2.X) - X;
|
||||
Height = Math.Max(p1.Y, p2.Y) - Y;
|
||||
}
|
||||
|
||||
public double X { get; }
|
||||
|
|
|
|||
Loading…
Reference in a new issue