Explorar o código

Removed debug code.
Added [GenerateEnumExtensionMethods] to DimAutoStyle.
Reordered DimAutoStyle.

Tig hai 1 ano
pai
achega
c7039a6658
Modificáronse 2 ficheiros con 11 adicións e 10 borrados
  1. 0 4
      Terminal.Gui/Text/TextFormatter.cs
  2. 11 6
      Terminal.Gui/View/Layout/DimAutoStyle.cs

+ 0 - 4
Terminal.Gui/Text/TextFormatter.cs

@@ -1,5 +1,3 @@
-using System.Diagnostics;
-
 namespace Terminal.Gui;
 namespace Terminal.Gui;
 
 
 /// <summary>
 /// <summary>
@@ -200,8 +198,6 @@ public class TextFormatter
             {
             {
                 _size = EnableNeedsFormat (value);
                 _size = EnableNeedsFormat (value);
             }
             }
-            Debug.Assert (Size.Width >= 0);
-            Debug.Assert (Size.Height >= 0);
         }
         }
     }
     }
 
 

+ 11 - 6
Terminal.Gui/View/Layout/DimAutoStyle.cs

@@ -1,16 +1,15 @@
+using Terminal.Gui.Analyzers.Internal.Attributes;
+
 namespace Terminal.Gui;
 namespace Terminal.Gui;
 
 
 /// <summary>
 /// <summary>
 ///     Specifies how <see cref="Dim.Auto"/> will compute the dimension.
 ///     Specifies how <see cref="Dim.Auto"/> will compute the dimension.
 /// </summary>
 /// </summary>
+[GenerateEnumExtensionMethods]
 [Flags]
 [Flags]
 public enum DimAutoStyle
 public enum DimAutoStyle
 {
 {
-    /// <summary>
-    ///     The dimension will be computed using both the view's <see cref="View.Text"/> and
-    ///     <see cref="View.Subviews"/> (whichever is larger).
-    /// </summary>
-    Auto = Content | Text,
+
 
 
     /// <summary>
     /// <summary>
     ///     The dimensions will be computed based on the View's non-Text content.
     ///     The dimensions will be computed based on the View's non-Text content.
@@ -39,5 +38,11 @@ public enum DimAutoStyle
     ///         The corresponding dimensions of the <see cref="View.Subviews"/> will be ignored.
     ///         The corresponding dimensions of the <see cref="View.Subviews"/> will be ignored.
     ///     </para>
     ///     </para>
     /// </summary>
     /// </summary>
-    Text = 1
+    Text = 1,
+
+    /// <summary>
+    ///     The dimension will be computed using both the view's <see cref="View.Text"/> and
+    ///     <see cref="View.Subviews"/> (whichever is larger).
+    /// </summary>
+    Auto = Content | Text,
 }
 }