forked from unoplatform/uno
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRectangleExtensions.iOS.cs
More file actions
100 lines (84 loc) · 2.66 KB
/
Copy pathRectangleExtensions.iOS.cs
File metadata and controls
100 lines (84 loc) · 2.66 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
using System.Drawing;
namespace Uno.UI.Extensions
{
public static class RectangleExtensions
{
public static RectangleF IncrementX (this RectangleF thisRectangleF, float delta)
{
thisRectangleF.X += delta;
return thisRectangleF;
}
public static RectangleF IncrementY (this RectangleF thisRectangleF, float delta)
{
thisRectangleF.Y += delta;
return thisRectangleF;
}
public static RectangleF SetX (this RectangleF thisRectangleF, float value)
{
thisRectangleF.X = value;
return thisRectangleF;
}
public static RectangleF SetY (this RectangleF thisRectangleF, float value)
{
thisRectangleF.Y = value;
return thisRectangleF;
}
public static RectangleF SetBottom (this RectangleF thisRectangleF, float value)
{
thisRectangleF.Height = value - thisRectangleF.Y;
return thisRectangleF;
}
public static RectangleF SetRight (this RectangleF thisRectangleF, float value)
{
thisRectangleF.Width = value - thisRectangleF.X;
return thisRectangleF;
}
public static RectangleF SetRightRespectWidth (this RectangleF thisRectangleF, float value)
{
thisRectangleF.X = value - thisRectangleF.Width;
return thisRectangleF;
}
public static RectangleF SetHorizontalCenter (this RectangleF thisRectangleF, float value)
{
thisRectangleF.X = value - (thisRectangleF.Width / 2);
return thisRectangleF;
}
public static RectangleF SetVerticalCenter (this RectangleF thisRectangleF, float value)
{
thisRectangleF.Y = value - (thisRectangleF.Height / 2);
return thisRectangleF;
}
public static RectangleF Shrink (this RectangleF thisRectangleF, float numberOfPixels)
{
thisRectangleF.Y += numberOfPixels;
thisRectangleF.X += numberOfPixels;
thisRectangleF.Width -= (numberOfPixels * 2);
thisRectangleF.Height -= (numberOfPixels * 2);
return thisRectangleF;
}
public static RectangleF IncrementHeight (this RectangleF thisRectangleF, float delta)
{
thisRectangleF.Height += delta;
return thisRectangleF;
}
public static RectangleF IncrementWidth (this RectangleF thisRectangleF, float delta)
{
thisRectangleF.Width += delta;
return thisRectangleF;
}
public static RectangleF SetWidth (this RectangleF thisRectangleF, float value)
{
thisRectangleF.Width = value;
return thisRectangleF;
}
public static RectangleF SetHeight (this RectangleF thisRectangleF, float value)
{
thisRectangleF.Height = value;
return thisRectangleF;
}
public static RectangleF Copy (this RectangleF thisRectangleF)
{
return new RectangleF (thisRectangleF.X, thisRectangleF.Y, thisRectangleF.Width, thisRectangleF.Height);
}
}
}