Files
Toolkit2/Toolkit.Windows/RectExtensions.cs
T
2024-11-02 20:57:13 +00:00

12 lines
364 B
C#

using Windows.Win32.Foundation;
namespace Toolkit.Windows;
internal static class RectExtensions
{
internal static Rect ToRect(this RECT rect) =>
rect.right - rect.left < 0 || rect.bottom - rect.top < 0
? new Rect(rect.left, rect.top, 0, 0)
: new Rect(rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top);
}