Browse Source

Backed out some changes and fixed unit tests

Tig 1 year ago
parent
commit
9b75effe49

+ 5 - 5
Terminal.Gui/View/Layout/ViewLayout.cs

@@ -66,7 +66,7 @@ public partial class View
         {
             if (_frame == value)
             {
-                return;
+                //return;
             }
 
             _frame = value with { Width = Math.Max (value.Width, 0), Height = Math.Max (value.Height, 0) };
@@ -169,7 +169,7 @@ public partial class View
 
             if (Equals (_x, value))
             {
-                return;
+                //return;
             }
             OnResizeNeeded ();
         }
@@ -205,7 +205,7 @@ public partial class View
         {
             if (Equals (_y, value))
             {
-                return;
+                //return;
             }
 
             _y = value ?? throw new ArgumentNullException (nameof (value), @$"{nameof (Y)} cannot be null");
@@ -243,7 +243,7 @@ public partial class View
         {
             if (Equals (_height, value))
             {
-                return;
+                //return;
             }
 
             _height = value ?? throw new ArgumentNullException (nameof (value), @$"{nameof (Height)} cannot be null");
@@ -298,7 +298,7 @@ public partial class View
         {
             if (Equals (_width, value))
             {
-                return;
+               // return;
             }
 
             _width = value ?? throw new ArgumentNullException (nameof (value), @$"{nameof (Width)} cannot be null");

+ 2 - 1
UnitTests/View/Layout/ToScreenTests.cs

@@ -550,7 +550,8 @@ public class ToScreenTests (ITestOutputHelper output)
         View view = new ()
         {
             Width = 10,
-            Height = 10
+            Height = 10,
+            ScrollSettings = ScrollSettings.NoRestrict
         };
 
         Rectangle testRect = new Rectangle (0, 0, 1, 1);

+ 2 - 1
UnitTests/View/Layout/ViewportTests.cs

@@ -160,7 +160,8 @@ public class ViewportTests (ITestOutputHelper output)
         View view = new ()
         {
             Width = 10,
-            Height = 10
+            Height = 10,
+            ScrollSettings = ScrollSettings.NoRestrict
         };
 
         Assert.Equal (new Rectangle (0, 0, 10, 10), view.Frame);