mirror of
https://github.com/spectreconsole/spectre.console.git
synced 2026-01-01 08:50:33 +01:00
Fix tree rendering
Fixes some tree rendering problems where lines were not properly drawn at some levels during some circumstances. * Change the API back to only allow one root. * Now uses a stack based approach to rendering instead of recursion. * Removes the need for measuring the whole tree in advance. Leave this up to each child to render.
This commit is contained in:
committed by
Patrik Svensson
parent
0e0f4b4220
commit
8261b25e5c
22
src/Spectre.Console/TreeGuide.cs
Normal file
22
src/Spectre.Console/TreeGuide.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using Spectre.Console.Rendering;
|
||||
|
||||
namespace Spectre.Console
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents tree guide lines.
|
||||
/// </summary>
|
||||
public abstract partial class TreeGuide
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the safe guide lines or <c>null</c> if none exist.
|
||||
/// </summary>
|
||||
public virtual TreeGuide? SafeTreeGuide { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Get the set of characters used to render the corresponding <see cref="TreeGuidePart"/>.
|
||||
/// </summary>
|
||||
/// <param name="part">The part of the tree to get rendering string for.</param>
|
||||
/// <returns>Rendering string for the tree part.</returns>
|
||||
public abstract string GetPart(TreeGuidePart part);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user