ソースを参照

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 11 ヶ月 前
コミット
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;