mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2026-01-01 08:50:25 +01:00
Use switch
This commit is contained in:
@@ -527,14 +527,13 @@ public class DimAuto () : Dim
|
||||
// Factor in adornments
|
||||
Thickness thickness = us.GetAdornmentsThickness ();
|
||||
|
||||
if (dimension == Dimension.Width)
|
||||
{
|
||||
max += thickness.Horizontal;
|
||||
}
|
||||
else
|
||||
{
|
||||
max += thickness.Vertical;
|
||||
}
|
||||
max += dimension switch
|
||||
{
|
||||
Dimension.Width => thickness.Horizontal,
|
||||
Dimension.Height => thickness.Vertical,
|
||||
Dimension.None => 0,
|
||||
_ => throw new ArgumentOutOfRangeException (nameof (dimension), dimension, null)
|
||||
};
|
||||
|
||||
// If max: is set, clamp the return - BUGBUG: Not tested
|
||||
return int.Min (max, MaximumContentDim?.GetAnchor (superviewContentSize) ?? max);
|
||||
|
||||
Reference in New Issue
Block a user