Files
NotificationFlyout/NotificationFlyout.Wpf.UI/Extensions/RECTExtensions.cs
T
Daniel Clark 45a9eb9cd2 init
2021-02-05 01:39:51 +00:00

16 lines
448 B
C#

using Microsoft.Windows.Sdk;
using System.Windows;
namespace NotificationFlyout.Wpf.UI.Extensions
{
internal static class RECTExtensions
{
internal static Rect ToRect(this RECT rect)
{
if (rect.right - rect.left < 0 || rect.bottom - rect.top < 0) return new Rect(rect.left, rect.top, 0, 0);
return new Rect(rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top);
}
}
}