-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
RectangleGeometry.cs
43 lines (36 loc) · 1.4 KB
/
RectangleGeometry.cs
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
#nullable disable
using Microsoft.Maui.Devices;
using Rect = Microsoft.Maui.Graphics.Rect;
namespace Microsoft.Maui.Controls.Shapes
{
/// <include file="../../../docs/Microsoft.Maui.Controls.Shapes/RectangleGeometry.xml" path="Type[@FullName='Microsoft.Maui.Controls.Shapes.RectangleGeometry']/Docs/*" />
public class RectangleGeometry : Geometry
{
/// <include file="../../../docs/Microsoft.Maui.Controls.Shapes/RectangleGeometry.xml" path="//Member[@MemberName='.ctor'][1]/Docs/*" />
public RectangleGeometry()
{
}
/// <include file="../../../docs/Microsoft.Maui.Controls.Shapes/RectangleGeometry.xml" path="//Member[@MemberName='.ctor'][2]/Docs/*" />
public RectangleGeometry(Rect rect)
{
Rect = rect;
}
/// <summary>Bindable property for <see cref="Rect"/>.</summary>
public static readonly BindableProperty RectProperty =
BindableProperty.Create(nameof(Rect), typeof(Rect), typeof(RectangleGeometry), new Rect());
/// <include file="../../../docs/Microsoft.Maui.Controls.Shapes/RectangleGeometry.xml" path="//Member[@MemberName='Rect']/Docs/*" />
public Rect Rect
{
set { SetValue(RectProperty, value); }
get { return (Rect)GetValue(RectProperty); }
}
public override void AppendPath(Graphics.PathF path)
{
float x = (float)Rect.X;
float y = (float)Rect.Y;
float w = (float)Rect.Width;
float h = (float)Rect.Height;
path.AppendRectangle(x, y, w, h);
}
}
}