2
0
Эх сурвалжийг харах

Fixes #1068. The ResizeView doesn't handle the AutoSize properly.

BDisp 4 жил өмнө
parent
commit
7febb7ac5c

+ 4 - 3
Terminal.Gui/Core/View.cs

@@ -1966,6 +1966,7 @@ namespace Terminal.Gui {
 
 		bool ResizeView (bool autoSize)
 		{
+			var aSize = autoSize;
 			if (textFormatter.Size != Bounds.Size && (((width == null || width is Dim.DimAbsolute) && (Bounds.Width == 0
 				|| autoSize && Bounds.Width != textFormatter.Size.Width))
 				|| ((height == null || height is Dim.DimAbsolute) && (Bounds.Height == 0
@@ -1976,17 +1977,17 @@ namespace Terminal.Gui {
 				} else if (width is Dim.DimAbsolute) {
 					width = Math.Max (Bounds.Width, height.Anchor (Bounds.Width));
 				} else {
-					return false;
+					aSize = false;
 				}
 				if (height == null) {
 					height = Bounds.Height;
 				} else if (height is Dim.DimAbsolute) {
 					height = Math.Max (Bounds.Height, height.Anchor (Bounds.Height));
 				} else {
-					return false;
+					aSize = false;
 				}
 			}
-			return autoSize;
+			return aSize;
 		}
 
 		/// <summary>

+ 1 - 2
UICatalog/Scenarios/Scrolling.cs

@@ -128,8 +128,7 @@ namespace UICatalog {
 			var horizontalRuler = new Label () {
 				X = 0,
 				Y = 0,
-				Width = Dim.Fill (1),  // BUGBUG: I don't think this should be needed; DimFill() should respect container's frame. X does.
-				Height = 1,
+				Width = Dim.Fill (),  // FIXED: I don't think this should be needed; DimFill() should respect container's frame. X does.
 				ColorScheme = Colors.Error
 			};
 			scrollView.Add (horizontalRuler);