mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2026-01-02 01:03:29 +01:00
WIP fixing 3469
This commit is contained in:
@@ -197,6 +197,8 @@ public class TextFormatter
|
||||
{
|
||||
_size = EnableNeedsFormat (value);
|
||||
}
|
||||
Debug.Assert (Size.Width >= 0);
|
||||
Debug.Assert (Size.Height >= 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -191,12 +191,12 @@ public partial class View
|
||||
|
||||
if (widthAuto is null || !widthAuto._style.HasFlag (Dim.DimAutoStyle.Text))
|
||||
{
|
||||
size.Width = _width.Anchor (0);
|
||||
size.Width = ContentSize.Value.Width;
|
||||
}
|
||||
|
||||
if (heightAuto is null || !heightAuto._style.HasFlag (Dim.DimAutoStyle.Text))
|
||||
{
|
||||
size.Height = _height.Anchor (0);
|
||||
size.Height = ContentSize.Value.Height;
|
||||
}
|
||||
|
||||
// Whenever DimAutoStyle.Text is set, ContentSize will match TextFormatter.Size.
|
||||
|
||||
@@ -303,4 +303,12 @@ public class PosAnchorEndTests (ITestOutputHelper output)
|
||||
Assert.Equal (5, result);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PosAnchorEnd_MinusOne_Combine_Works ()
|
||||
{
|
||||
var pos = AnchorEnd () - 1;
|
||||
var result = pos.Calculate (10, new DimAbsolute (2), null, Dimension.None);
|
||||
Assert.Equal (7, result);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user