mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-06-19 21:38:16 +08:00
Figlet text should not pad on right side automatically
This commit is contained in:

committed by
Patrik Svensson

parent
02ff3fc910
commit
55c3f3b7a8
@ -16,6 +16,13 @@ public sealed class FigletText : Renderable, IHasJustification
|
||||
/// <inheritdoc/>
|
||||
public Justify? Justification { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether or not
|
||||
/// the right side should be padded.
|
||||
/// </summary>
|
||||
/// <remarks>Defaults to <c>false</c>.</remarks>
|
||||
public bool Pad { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="FigletText"/> class.
|
||||
/// </summary>
|
||||
@ -53,7 +60,7 @@ public sealed class FigletText : Renderable, IHasJustification
|
||||
{
|
||||
yield return line;
|
||||
|
||||
if (lineWidth < maxWidth)
|
||||
if (lineWidth < maxWidth && Pad)
|
||||
{
|
||||
yield return Segment.Padding(maxWidth - lineWidth);
|
||||
}
|
||||
@ -65,7 +72,11 @@ public sealed class FigletText : Renderable, IHasJustification
|
||||
|
||||
yield return Segment.Padding(left);
|
||||
yield return line;
|
||||
yield return Segment.Padding(right);
|
||||
|
||||
if (Pad)
|
||||
{
|
||||
yield return Segment.Padding(right);
|
||||
}
|
||||
}
|
||||
else if (alignment == Console.Justify.Right)
|
||||
{
|
||||
|
Reference in New Issue
Block a user