12345678910111213141516171819202122232425262728293031 |
- using Avalonia;
- using Avalonia.Controls;
- using Avalonia.Controls.Shapes;
- using Avalonia.Media;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace InABox.Avalonia.Components.ImageEditing;
- internal class PolylineObject : IImageEditorObject
- {
- public List<Point> Points { get; set; } = new List<Point>();
- public double Thickness { get; set; } = 1.0;
- public IBrush? PrimaryBrush { get; set; }
- private Polyline Control = new();
- public Control GetControl() => Control;
- public void Update()
- {
- Control.Points = Points.ToList();
- Control.Stroke = PrimaryBrush;
- Control.StrokeThickness = Thickness;
- Control.StrokeLineCap = PenLineCap.Round;
- Control.StrokeJoin = PenLineJoin.Round;
- }
- }
|