1using System.Collections.Generic;
11 private readonly List<SKPoint> vertices;
20 this.vertices =
new List<SKPoint>() {
new SKPoint(X0, Y0) };
28 public void Add(
float X,
float Y)
30 this.vertices.Add(
new SKPoint(X, Y));
39 return this.vertices.ToArray();
49 public bool TryGetStart(out
float X, out
float Y, out
float Direction)
51 int c = this.vertices.Count;
54 X = Y = Direction = 0;
58 SKPoint P0 = this.vertices[0];
59 SKPoint P1 = this.vertices[1];
60 float dx = P1.X - P0.X;
61 float dy = P1.Y - P0.Y;
77 public bool TryGetEnd(out
float X, out
float Y, out
float Direction)
79 int c = this.vertices.Count;
82 X = Y = Direction = 0;
86 SKPoint P0 = this.vertices[c - 2];
87 SKPoint P1 = this.vertices[c - 1];
88 float dx = P1.X - P0.X;
89 float dy = P1.Y - P0.Y;
Abstract base class for layout elements.
static float CalcDirection(float x1, float y1, float x2, float y2)
Calculates the direction of the pen when drawing from (x1,y1) to (x2,y2).
Interface for directed elements.