restructure
This commit is contained in:
30
PCPalConfigurator/Rendering/Elements/RectElement.cs
Normal file
30
PCPalConfigurator/Rendering/Elements/RectElement.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System.Drawing;
|
||||
|
||||
namespace PCPalConfigurator.Rendering.Elements
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a rectangle or box element in the OLED preview
|
||||
/// </summary>
|
||||
public class RectElement : PreviewElement
|
||||
{
|
||||
public int X { get; set; }
|
||||
public int Y { get; set; }
|
||||
public int Width { get; set; }
|
||||
public int Height { get; set; }
|
||||
public bool Filled { get; set; }
|
||||
|
||||
public override void Draw(Graphics g)
|
||||
{
|
||||
if (Filled)
|
||||
{
|
||||
// Draw filled box
|
||||
g.FillRectangle(Brushes.White, X, Y, Width, Height);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Draw outline rectangle
|
||||
g.DrawRectangle(Pens.White, X, Y, Width, Height);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user