Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
Segment.cs
1using SkiaSharp;
2using System;
3
5{
9 public class Segment : IDisposable
10 {
14 public string Text { get; set; }
15
19 public SKFont Font { get; set; }
20
24 public SKPaint Paint { get; set; }
25
29 public SKRect Bounds { get; set; }
30
34 public SKRect SpaceBounds { get; set; }
35
39 public float Width => this.Bounds.Width;
40
44 public float Height => this.Bounds.Height;
45
49 public float Top => this.Bounds.Top;
50
54 public float Bottom => this.Bounds.Bottom;
55
59 public float SpaceWidth => this.SpaceBounds.Width;
60
64 public float SpaceHeight => this.SpaceBounds.Height;
65
69 public float? LinePos { get; set; }
70
74 public float DeltaY { get; set; }
75
79 public bool SpaceAfter { get; set; }
80
84 public void Dispose()
85 {
86 this.Paint?.Dispose();
87 this.Paint = null;
88 }
89
91 public override string ToString()
92 {
93 return this.Text;
94 }
95
100 public void TranslateY(float DeltaY)
101 {
102 if (DeltaY != 0)
103 {
104 this.Bounds = new SKRect(this.Bounds.Left, this.Bounds.Top + DeltaY,
105 this.Bounds.Right, this.Bounds.Bottom + DeltaY);
106 }
107 }
108 }
109}
Contains information about a segment of flowing text.
Definition: Segment.cs:10
bool SpaceAfter
If there's white-space after the segment
Definition: Segment.cs:79
SKRect SpaceBounds
Bounds of a space character.
Definition: Segment.cs:34
float SpaceHeight
Height of a space character.
Definition: Segment.cs:64
float? LinePos
Position on optional horizontal line.
Definition: Segment.cs:69
void TranslateY(float DeltaY)
Moves the segment along the Y-axis.
Definition: Segment.cs:100
float SpaceWidth
Width of a space character.
Definition: Segment.cs:59
Represents a segment of text in flowing text.
Definition: Text.cs:14