Преглед изворни кода

Make GetAnchor abstract

There are subtle reasons for this. Regardless, it will be abstract when it's an interface, anyway, so no harm in doing it now.
Brandon Thetford пре 1 година
родитељ
комит
8385153590
2 измењених фајлова са 4 додато и 1 уклоњено
  1. 1 1
      Terminal.Gui/View/Layout/Dim.cs
  2. 3 0
      Terminal.Gui/View/Layout/DimAuto.cs

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

@@ -233,7 +233,7 @@ public abstract record Dim : IEqualityOperators<Dim, Dim, bool>
     ///     subclass of Dim that is used. For example, DimAbsolute returns a fixed dimension, DimFactor returns a
     ///     dimension that is a certain percentage of the super view's size, and so on.
     /// </returns>
-    internal virtual int GetAnchor (int size) { return 0; }
+    internal abstract int GetAnchor (int size);
 
     /// <summary>
     ///     Calculates and returns the dimension of a <see cref="View"/> object. It takes into account the location of the

+ 3 - 0
Terminal.Gui/View/Layout/DimAuto.cs

@@ -59,6 +59,9 @@ public record DimAuto : Dim
     /// <inheritdoc/>
     public override string ToString () { return $"Auto({Style},{MinimumContentDim},{MaximumContentDim})"; }
 
+    /// <inheritdoc />
+    internal override int GetAnchor (int size) => 0;
+
     internal override int Calculate (int location, int superviewContentSize, View us, Dimension dimension)
     {
         var textSize = 0;