优化更新代码,添加界面功能并整合
This commit is contained in:
26
WPFluent/Interop/WinDef/RECT.cs
Normal file
26
WPFluent/Interop/WinDef/RECT.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace WPFluent.Interop.WinDef;
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct RECT(int left, int top, int right, int bottom)
|
||||
{
|
||||
public int Left = left;
|
||||
public int Top = top;
|
||||
public int Right = right;
|
||||
public int Bottom = bottom;
|
||||
|
||||
public int Width => Right - Left;
|
||||
|
||||
public int Height => Bottom - Top;
|
||||
|
||||
public void Offset(int dx, int dy)
|
||||
{
|
||||
Left += dx;
|
||||
Top += dy;
|
||||
Right += dx;
|
||||
Bottom += dy;
|
||||
}
|
||||
|
||||
public bool IsEmpty => Left >= Right || Top >= Bottom;
|
||||
}
|
||||
Reference in New Issue
Block a user