Partial fix

This commit is contained in:
Tig
2024-05-12 20:47:03 -06:00
parent 65caf28e8a
commit a8b9ddb2aa
6 changed files with 93 additions and 48 deletions

View File

@@ -1855,11 +1855,6 @@ Y
Application.Begin (top);
((FakeDriver)Application.Driver).SetBufferSize (width + 2, 6);
Assert.True (lblLeft.TextFormatter.AutoSize == autoSize);
Assert.True (lblCenter.TextFormatter.AutoSize == autoSize);
Assert.True (lblRight.TextFormatter.AutoSize == autoSize);
Assert.True (lblJust.TextFormatter.AutoSize == autoSize);
if (autoSize)
{
Size expectedSize = new (11, 1);
@@ -1983,11 +1978,6 @@ Y
Application.Begin (top);
((FakeDriver)Application.Driver).SetBufferSize (9, height + 2);
Assert.True (lblLeft.TextFormatter.AutoSize == autoSize);
Assert.True (lblCenter.TextFormatter.AutoSize == autoSize);
Assert.True (lblRight.TextFormatter.AutoSize == autoSize);
Assert.True (lblJust.TextFormatter.AutoSize == autoSize);
if (autoSize)
{
Assert.Equal (new (1, 11), lblLeft.TextFormatter.Size);

View File

@@ -130,6 +130,26 @@ public class TextTests (ITestOutputHelper output)
Assert.Equal (new Rectangle (0, 0, 5, 1), view.Viewport);
}
// BUGBUG: this is a temporary test that helped identify #3469 - It needs to be expanded upon (and renamed)
[Fact]
public void TextDirection_Horizontal_Dims_Correct_WidthAbsolute ()
{
var view = new View
{
Text = "01234",
TextDirection = TextDirection.LeftRight_TopBottom,
TextAlignment = Alignment.Centered,
Width = 10,
Height = Dim.Auto (Dim.DimAutoStyle.Text)
};
view.BeginInit ();
view.EndInit ();
Assert.Equal (new Rectangle (0, 0, 10, 1), view.Frame);
Assert.Equal (new Rectangle (0, 0, 10, 1), view.Viewport);
Assert.Equal (new (10, 1), view.TextFormatter.Size);
}
[Fact]
public void TextDirection_Vertical_Dims_Correct ()
{