Fixed error in Textformatter

This commit is contained in:
Tig
2024-07-19 16:07:14 -06:00
parent 153f1015d7
commit c6a9021f2e
2 changed files with 1 additions and 22 deletions

View File

@@ -1967,7 +1967,7 @@ public class TextFormatter
/// <returns>The index of the text that fit the width.</returns>
public static int GetLengthThatFits (string text, int width, int tabWidth = 0, TextDirection textDirection = TextDirection.LeftRight_TopBottom)
{
return GetLengthThatFits (text.ToRuneList (), width, tabWidth, textDirection);
return GetLengthThatFits (text?.ToRuneList () ?? [], width, tabWidth, textDirection);
}
/// <summary>Gets the number of the Runes in a list of Runes that will fit in <paramref name="width"/>.</summary>

View File

@@ -1,27 +1,6 @@
#nullable enable
namespace Terminal.Gui;
/// <summary>
/// Represents the state of a <see cref="CheckBox"/>.
/// </summary>
public enum CheckState
{
/// <summary>
/// Neither checked nor unchecked.
/// </summary>
None,
/// <summary>
/// Checked.
/// </summary>
Checked,
/// <summary>
/// Not checked.
/// </summary>
UnChecked
}
/// <summary>Shows a check box that can be toggled.</summary>
public class CheckBox : View
{