Selaa lähdekoodia

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 kuukautta sitten
vanhempi
commit
8385153590
2 muutettua tiedostoa jossa 4 lisäystä ja 1 poistoa
  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
     ///     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.
     ///     dimension that is a certain percentage of the super view's size, and so on.
     /// </returns>
     /// </returns>
-    internal virtual int GetAnchor (int size) { return 0; }
+    internal abstract int GetAnchor (int size);
 
 
     /// <summary>
     /// <summary>
     ///     Calculates and returns the dimension of a <see cref="View"/> object. It takes into account the location of the
     ///     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/>
     /// <inheritdoc/>
     public override string ToString () { return $"Auto({Style},{MinimumContentDim},{MaximumContentDim})"; }
     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)
     internal override int Calculate (int location, int superviewContentSize, View us, Dimension dimension)
     {
     {
         var textSize = 0;
         var textSize = 0;