|
@@ -7,7 +7,7 @@ using ShapeData = PixiEditor.ChangeableDocument.Changeables.Graph.Nodes.Shapes.D
|
|
namespace PixiEditor.ChangeableDocument.Changeables.Graph.Nodes.Shapes;
|
|
namespace PixiEditor.ChangeableDocument.Changeables.Graph.Nodes.Shapes;
|
|
|
|
|
|
[NodeInfo("Ellipse", "ELLIPSE_NODE", Category = "SHAPE")]
|
|
[NodeInfo("Ellipse", "ELLIPSE_NODE", Category = "SHAPE")]
|
|
-public class EllipseNode : ShapeNode
|
|
|
|
|
|
+public class EllipseNode : ShapeNode<EllipseData>
|
|
{
|
|
{
|
|
public InputProperty<VecD> Position { get; }
|
|
public InputProperty<VecD> Position { get; }
|
|
public InputProperty<VecD> Radius { get; }
|
|
public InputProperty<VecD> Radius { get; }
|
|
@@ -19,13 +19,13 @@ public class EllipseNode : ShapeNode
|
|
{
|
|
{
|
|
Position = CreateInput<VecD>("Position", "POSITION", VecI.Zero);
|
|
Position = CreateInput<VecD>("Position", "POSITION", VecI.Zero);
|
|
Radius = CreateInput<VecD>("Radius", "RADIUS", new VecD(32, 32)).WithRules(
|
|
Radius = CreateInput<VecD>("Radius", "RADIUS", new VecD(32, 32)).WithRules(
|
|
- v => v.Min(VecI.One));
|
|
|
|
|
|
+ v => v.Min(new VecD(1)));
|
|
StrokeColor = CreateInput<Color>("StrokeColor", "STROKE_COLOR", new Color(0, 0, 0, 255));
|
|
StrokeColor = CreateInput<Color>("StrokeColor", "STROKE_COLOR", new Color(0, 0, 0, 255));
|
|
FillColor = CreateInput<Color>("FillColor", "FILL_COLOR", new Color(0, 0, 0, 255));
|
|
FillColor = CreateInput<Color>("FillColor", "FILL_COLOR", new Color(0, 0, 0, 255));
|
|
StrokeWidth = CreateInput<int>("StrokeWidth", "STROKE_WIDTH", 1);
|
|
StrokeWidth = CreateInput<int>("StrokeWidth", "STROKE_WIDTH", 1);
|
|
}
|
|
}
|
|
|
|
|
|
- protected override ShapeData? GetShapeData(RenderingContext context)
|
|
|
|
|
|
+ protected override EllipseData? GetShapeData(RenderingContext context)
|
|
{
|
|
{
|
|
return new EllipseData(Position.Value, Radius.Value)
|
|
return new EllipseData(Position.Value, Radius.Value)
|
|
{ StrokeColor = StrokeColor.Value, FillColor = FillColor.Value, StrokeWidth = StrokeWidth.Value };
|
|
{ StrokeColor = StrokeColor.Value, FillColor = FillColor.Value, StrokeWidth = StrokeWidth.Value };
|