-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRectangle.cs
More file actions
37 lines (29 loc) · 755 Bytes
/
Rectangle.cs
File metadata and controls
37 lines (29 loc) · 755 Bytes
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
// Developed by Bulat Bagaviev (@sunnyyssh).
// This file is licensed to you under the MIT license.
namespace Sunnyyssh.ConsoleUI;
public sealed class Rectangle : UIElement
{
private Color _color;
public Color Color
{
get => _color;
set
{
_color = value;
if (IsStateInitialized)
{
Redraw(CreateDrawState());
}
}
}
protected override DrawState CreateDrawState()
{
var builder = new DrawStateBuilder(Width, Width);
builder.Fill(Color);
return builder.ToDrawState();
}
internal Rectangle(int width, int height, OverlappingPriority priority)
: base(width, height, priority)
{
}
}