mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-04-16 00:42:51 +08:00
Figlet text should not pad on right side automatically
This commit is contained in:
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,8 +72,12 @@ public sealed class FigletText : Renderable, IHasJustification
|
||||
|
||||
yield return Segment.Padding(left);
|
||||
yield return line;
|
||||
|
||||
if (Pad)
|
||||
{
|
||||
yield return Segment.Padding(right);
|
||||
}
|
||||
}
|
||||
else if (alignment == Console.Justify.Right)
|
||||
{
|
||||
if (lineWidth < maxWidth)
|
||||
|
@ -1,4 +1,4 @@
|
||||
.______ ___ .___________..______ __ __ ___ ____ __ ____ ___ _______. __ __ _______ .______ _______
|
||||
.______ ___ .___________..______ __ __ ___ ____ __ ____ ___ _______. __ __ _______ .______ _______
|
||||
| _ \ / \ | || _ \ | | | |/ / \ \ / \ / / / \ / | | | | | | ____|| _ \ | ____|
|
||||
| |_) | / ^ \ `---| |----`| |_) | | | | ' / \ \/ \/ / / ^ \ | (----` | |__| | | |__ | |_) | | |__
|
||||
| ___/ / /_\ \ | | | / | | | < \ / / /_\ \ \ \ | __ | | __| | / | __|
|
||||
|
@ -1,4 +1,4 @@
|
||||
____ _ _ _
|
||||
____ _ _ _
|
||||
| _ \ __ _ | |_ _ __ (_) | | __ __ __ __ _ ___
|
||||
| |_) | / _` | | __| | '__| | | | |/ / \ \ /\ / / / _` | / __|
|
||||
| __/ | (_| | | |_ | | | | | < \ V V / | (_| | \__ \
|
||||
|
@ -1,4 +1,4 @@
|
||||
____ _ ____ _
|
||||
____ _ ____ _
|
||||
/ ___| _ __ ___ ___ | |_ _ __ ___ / ___| ___ _ __ ___ ___ | | ___
|
||||
\___ \ | '_ \ / _ \ / __| | __| | '__| / _ \ | | / _ \ | '_ \ / __| / _ \ | | / _ \
|
||||
___) | | |_) | | __/ | (__ | |_ | | | __/ _ | |___ | (_) | | | | | \__ \ | (_) | | | | __/
|
||||
|
@ -1,4 +1,4 @@
|
||||
____ _ ____ _
|
||||
____ _ ____ _
|
||||
/ ___| _ __ ___ ___ | |_ _ __ ___ / ___| ___ _ __ ___ ___ | | ___
|
||||
\___ \ | '_ \ / _ \ / __| | __| | '__| / _ \ | | / _ \ | '_ \ / __| / _ \ | | / _ \
|
||||
___) | | |_) | | __/ | (__ | |_ | | | __/ _ | |___ | (_) | | | | | \__ \ | (_) | | | | __/
|
||||
|
@ -1,4 +1,4 @@
|
||||
____ _ ____
|
||||
____ _ ____
|
||||
/ ___| _ __ ___ ___ | |_ _ __ ___ / ___| ___
|
||||
\___ \ | '_ \ / _ \ / __| | __| | '__| / _ \ | | / _ \
|
||||
___) | | |_) | | __/ | (__ | |_ | | | __/ _ | |___ | (_) |
|
||||
|
Loading…
x
Reference in New Issue
Block a user