Add text overflow support

Closes #61
This commit is contained in:
Patrik Svensson
2020-09-03 14:34:13 +02:00
committed by Patrik Svensson
parent 88edfe68ec
commit 9f8ca6d648
8 changed files with 282 additions and 31 deletions

View File

@@ -10,7 +10,7 @@ namespace Spectre.Console
/// </summary>
[DebuggerDisplay("{_text,nq}")]
[SuppressMessage("Naming", "CA1724:Type names should not match namespaces")]
public sealed class Text : Renderable, IAlignable
public sealed class Text : Renderable, IAlignable, IOverflowable
{
private readonly Paragraph _paragraph;
@@ -38,6 +38,15 @@ namespace Spectre.Console
set => _paragraph.Alignment = value;
}
/// <summary>
/// Gets or sets the text overflow strategy.
/// </summary>
public Overflow? Overflow
{
get => _paragraph.Overflow;
set => _paragraph.Overflow = value;
}
/// <inheritdoc/>
protected override Measurement Measure(RenderContext context, int maxWidth)
{