Fixing TextFormatter unit test.

This commit is contained in:
BDisp
2020-08-01 00:27:32 +01:00
parent 6a571163ab
commit 746cdc262d
2 changed files with 3 additions and 3 deletions

View File

@@ -47,7 +47,7 @@ namespace Terminal.Gui {
set {
text = value;
if (Size.Width == 0 || Size.Height == 0 || Size.Width != text.RuneCount) {
if (text.RuneCount > 0 && (Size.Width == 0 || Size.Height == 0 || Size.Width != text.RuneCount)) {
// Proivde a default size (width = length of longest line, height = 1)
// TODO: It might makem more sense for the default to be width = length of first line?
Size = new Size (TextFormatter.MaxWidth (Text, int.MaxValue), 1);