using System;
namespace Terminal.Gui {
///
/// Draws a single line using the specified by .
///
public class Line : View {
private Orientation _orientation;
///
/// 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.
///
public Orientation Orientation { get => _orientation; set => _orientation = value; }
///
/// Constructs a Line object.
///
public Line ()
{
}
///
public override bool OnDrawFrames ()
{
var screenBounds = ViewToScreen (Bounds);
LineCanvas lc;
lc = SuperView?.LineCanvas;
lc.AddLine (screenBounds.Location, Orientation == Orientation.Horizontal ? Frame.Width : Frame.Height, Orientation, BorderStyle);
return true;
}
//public override void OnDrawContentComplete (Rect contentArea)
//{
// var screenBounds = ViewToScreen (Frame);
//}
///
public override void OnDrawContent (Rect contentArea)
{
OnDrawFrames ();
}
}
}