41 lines
1 KiB
C#
41 lines
1 KiB
C#
using System.Numerics;
|
|
using Avalonia;
|
|
using SimpleDrawing;
|
|
|
|
namespace Shapes.Shapes;
|
|
|
|
public sealed class Triangle : Shape
|
|
{
|
|
private const int SideLengthMin = 10;
|
|
private const int SideLengthMax = 150;
|
|
|
|
public Triangle(Vector2 position, Vector2 scale)
|
|
: base(position, new Vector2(
|
|
Math.Clamp(scale.X, SideLengthMin, SideLengthMax),
|
|
Math.Clamp(scale.Y, SideLengthMin, SideLengthMax)))
|
|
{
|
|
// Clamp the scale values directly in the base ctor
|
|
}
|
|
|
|
public override bool DrawSelf(Vector2 position = default, Vector2 scale = default)
|
|
{
|
|
if (position == default)
|
|
{
|
|
position = Position;
|
|
}
|
|
|
|
if (scale == default)
|
|
{
|
|
scale = Scale;
|
|
}
|
|
|
|
// TODO
|
|
return false;
|
|
}
|
|
|
|
public override bool PointInShape(Vector2 mousePoint)
|
|
{
|
|
// TODO
|
|
return false;
|
|
}
|
|
}
|