Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
LineToRel.cs
1using System.Threading.Tasks;
2using SkiaSharp;
3
5{
9 public class LineToRel : LineTo
10 {
16 public LineToRel(Layout2DDocument Document, ILayoutElement Parent)
17 : base(Document, Parent)
18 {
19 }
20
24 public override string LocalName => "LineToRel";
25
32 public override ILayoutElement Create(Layout2DDocument Document, ILayoutElement Parent)
33 {
34 return new LineToRel(Document, Parent);
35 }
36
42 public override Task Measure(DrawingState State, PathState PathState)
43 {
44 if (this.defined)
46
47 return Task.CompletedTask;
48 }
49
56 public override Task Draw(DrawingState State, PathState PathState, SKPath Path)
57 {
58 if (this.defined)
59 {
60 this.P1 = Path.LastPoint;
61 Path.LineTo(PathState.Add(this.xCoordinate, this.yCoordinate));
62 this.P2 = Path.LastPoint;
63 }
64
65 return Task.CompletedTask;
66 }
67
68 }
69}
Contains a 2D layout document.
Draws a line to a point, relative to the origio of the current container
Definition: LineTo.cs:10
Draws a line to a point, relative to the end of the last segment
Definition: LineToRel.cs:10
override string LocalName
Local name of type of element.
Definition: LineToRel.cs:24
LineToRel(Layout2DDocument Document, ILayoutElement Parent)
Draws a line to a point, relative to the end of the last segment
Definition: LineToRel.cs:16
override Task Draw(DrawingState State, PathState PathState, SKPath Path)
Draws layout entities.
Definition: LineToRel.cs:56
override Task Measure(DrawingState State, PathState PathState)
Measures layout entities and defines unassigned properties.
Definition: LineToRel.cs:42
override ILayoutElement Create(Layout2DDocument Document, ILayoutElement Parent)
Creates a new instance of the layout element.
Definition: LineToRel.cs:32
SKPoint Add(float DeltaX, float DeltaY)
Sets a new coordinate
Definition: PathState.cs:185
bool defined
If element is well-defined.
float yCoordinate
Measured Y-coordinate
Definition: Point.cs:122
float xCoordinate
Measured X-coordinate
Definition: Point.cs:117
Base interface for all layout elements.