mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 07:47:54 +01:00
Maybe fix #4444
This commit is contained in:
@@ -55,9 +55,15 @@ public record DimAuto (Dim? MaximumContentDim, Dim? MinimumContentDim, DimAutoSt
|
||||
{
|
||||
if (us.TextFormatter.ConstrainToHeight is null)
|
||||
{
|
||||
int width = int.Min (autoMax, screenX4);
|
||||
if (us.TextFormatter.ConstrainToWidth is null)
|
||||
{
|
||||
width = us.TextFormatter.FormatAndGetSize (new (us.Viewport.Width, screenX4)).Width;
|
||||
}
|
||||
|
||||
// Set just the height. It is assumed that the width has already been set.
|
||||
// TODO: There may be cases where the width is not set. We may need to set it here.
|
||||
textSize = us.TextFormatter.FormatAndGetSize (new (us.TextFormatter.ConstrainToWidth ?? screenX4, int.Min (autoMax, screenX4))).Height;
|
||||
textSize = us.TextFormatter.FormatAndGetSize (new (us.TextFormatter.ConstrainToWidth ?? width, screenX4)).Height;
|
||||
us.TextFormatter.ConstrainToHeight = textSize;
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user