forked from AtomicGameEngine/AtomicGameEngine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRect.cs
More file actions
77 lines (65 loc) · 1.37 KB
/
Rect.cs
File metadata and controls
77 lines (65 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
using System.Runtime.InteropServices;
namespace AtomicEngine
{
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct Rect
{
public Rect(float left, float top, float right, float bottom)
{
Min.X = left;
Min.Y = top;
Max.X = right;
Max.Y = bottom;
}
public float Left
{
get
{
return Min.X;
}
set
{
Min.X = value;
}
}
public float Right
{
get
{
return Max.X;
}
set
{
Max.X = value;
}
}
public float Top
{
get
{
return Min.Y;
}
set
{
Min.Y = value;
}
}
public float Bottom
{
get
{
return Max.Y;
}
set
{
Max.Y = value;
}
}
public float Width { get { return Max.X - Min.X; } }
public float Height { get { return Max.Y - Min.Y; } }
/// Minimum vector.
public Vector2 Min;
/// Maximum vector.
public Vector2 Max;
}
}