Преглед на файлове

Clamping to maximum size of the buffer

Just an extra sanity check/guard
Brandon Thetford преди 1 година
родител
ревизия
9082d13e30
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      Terminal.Gui/View/Layout/Dim.cs

+ 1 - 1
Terminal.Gui/View/Layout/Dim.cs

@@ -253,7 +253,7 @@ public abstract record Dim : IEqualityOperators<Dim, Dim, bool>
     /// </returns>
     internal virtual int Calculate (int location, int superviewContentSize, View us, Dimension dimension)
     {
-        return Math.Max (GetAnchor (superviewContentSize - location), 0);
+        return Math.Clamp (GetAnchor (superviewContentSize - location), 0, short.MaxValue);
     }
 
     /// <summary>