mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-31 02:08:03 +01:00
26 lines
892 B
C#
26 lines
892 B
C#
namespace Terminal.Gui;
|
|
|
|
/// <summary>Draws a single line using the <see cref="LineStyle"/> specified by <see cref="View.BorderStyle"/>.</summary>
|
|
public class Line : View
|
|
{
|
|
/// <summary>Constructs a Line object.</summary>
|
|
public Line () { }
|
|
|
|
/// <summary>
|
|
/// The direction of the line. If you change this you will need to manually update the Width/Height of the
|
|
/// control to cover a relevant area based on the new direction.
|
|
/// </summary>
|
|
public Orientation Orientation { get; set; }
|
|
|
|
/// <inheritdoc/>
|
|
public override void OnDrawContent (Rectangle contentArea)
|
|
{
|
|
LineCanvas.AddLine (
|
|
BoundsToScreen (contentArea).Location,
|
|
Orientation == Orientation.Horizontal ? Frame.Width : Frame.Height,
|
|
Orientation,
|
|
BorderStyle
|
|
);
|
|
}
|
|
}
|