Fixes #1750. Erroneous suppression of Button Text updates. (#1752)

* - Fix upstream issue 1750
- Unexplained breakage in odd test "Update_Only_On_Or_After_Initialize"

* Add workaround in Button.cs for erroneous text width caching in TextFormatter

* - Revert earlier attempted workaround for update issue

* Fix TextFormatter erroneous width caching issue when new runecount matched previous width in columns, add regression test, revert temporary workaround from Button.cs

* Add new unit test Update_Parameterless_Only_On_Or_After_Initialize
This commit is contained in:
James A Sutherland
2022-05-28 23:11:24 +01:00
committed by GitHub
parent d68a2e8b8c
commit efb654e6d9
4 changed files with 58 additions and 11 deletions

View File

@@ -65,6 +65,15 @@ namespace Terminal.Gui.Core {
Assert.NotEmpty (tf.Lines);
}
[Fact]
public void TestSize_TextChange ()
{
var tf = new TextFormatter () { Text = "你" };
Assert.Equal (2,tf.Size.Width);
tf.Text = "你你";
Assert.Equal (4, tf.Size.Width);
}
[Fact]
public void NeedsFormat_Sets ()
{