瀏覽代碼

Fixes AutoSize, Window Tile and added option to Border for fill or not.

BDisp 3 年之前
父節點
當前提交
a82ac45843

+ 15 - 7
Terminal.Gui/Core/Border.cs

@@ -460,15 +460,17 @@ namespace Terminal.Gui {
 		/// Drawn the <see cref="BorderThickness"/> more the <see cref="Padding"/>
 		/// Drawn the <see cref="BorderThickness"/> more the <see cref="Padding"/>
 		///  more the <see cref="Border.BorderStyle"/> and the <see cref="Effect3D"/>.
 		///  more the <see cref="Border.BorderStyle"/> and the <see cref="Effect3D"/>.
 		/// </summary>
 		/// </summary>
-		public void DrawContent (View view = null)
+		/// <param name="view">The view to draw.</param>
+		/// <param name="fill">If it will clear or not the content area.</param>
+		public void DrawContent (View view = null, bool fill = true)
 		{
 		{
 			if (Child == null) {
 			if (Child == null) {
 				Child = view;
 				Child = view;
 			}
 			}
 			if (Parent?.Border != null) {
 			if (Parent?.Border != null) {
-				DrawParentBorder (Parent.ViewToScreen (Parent.Bounds));
+				DrawParentBorder (Parent.ViewToScreen (Parent.Bounds), fill);
 			} else {
 			} else {
-				DrawChildBorder (Child.ViewToScreen (Child.Bounds));
+				DrawChildBorder (Child.ViewToScreen (Child.Bounds), fill);
 			}
 			}
 		}
 		}
 
 
@@ -559,7 +561,7 @@ namespace Terminal.Gui {
 			}
 			}
 		}
 		}
 
 
-		private void DrawChildBorder (Rect frame)
+		private void DrawChildBorder (Rect frame, bool fill = true)
 		{
 		{
 			var drawMarginFrame = DrawMarginFrame ? 1 : 0;
 			var drawMarginFrame = DrawMarginFrame ? 1 : 0;
 			var sumThickness = GetSumThickness ();
 			var sumThickness = GetSumThickness ();
@@ -663,7 +665,7 @@ namespace Terminal.Gui {
 				Height = frame.Height + (2 * drawMarginFrame)
 				Height = frame.Height + (2 * drawMarginFrame)
 			};
 			};
 			if (rect.Width > 0 && rect.Height > 0) {
 			if (rect.Width > 0 && rect.Height > 0) {
-				driver.DrawWindowFrame (rect, 1, 1, 1, 1, BorderStyle != BorderStyle.None, fill: true, this);
+				driver.DrawWindowFrame (rect, 1, 1, 1, 1, BorderStyle != BorderStyle.None, fill, this);
 			}
 			}
 
 
 			if (Effect3D) {
 			if (Effect3D) {
@@ -712,7 +714,7 @@ namespace Terminal.Gui {
 			driver.SetAttribute (savedAttribute);
 			driver.SetAttribute (savedAttribute);
 		}
 		}
 
 
-		private void DrawParentBorder (Rect frame)
+		private void DrawParentBorder (Rect frame, bool fill = true)
 		{
 		{
 			var sumThickness = GetSumThickness ();
 			var sumThickness = GetSumThickness ();
 			var borderThickness = BorderThickness;
 			var borderThickness = BorderThickness;
@@ -815,7 +817,7 @@ namespace Terminal.Gui {
 				Height = Math.Max (frame.Height - sumThickness.Bottom - sumThickness.Top, 0)
 				Height = Math.Max (frame.Height - sumThickness.Bottom - sumThickness.Top, 0)
 			};
 			};
 			if (rect.Width > 0 && rect.Height > 0) {
 			if (rect.Width > 0 && rect.Height > 0) {
-				driver.DrawWindowFrame (rect, 1, 1, 1, 1, BorderStyle != BorderStyle.None, fill: true, this);
+				driver.DrawWindowFrame (rect, 1, 1, 1, 1, BorderStyle != BorderStyle.None, fill, this);
 			}
 			}
 
 
 			if (Effect3D) {
 			if (Effect3D) {
@@ -873,6 +875,12 @@ namespace Terminal.Gui {
 
 
 		private void AddRuneAt (ConsoleDriver driver, int col, int row, Rune ch)
 		private void AddRuneAt (ConsoleDriver driver, int col, int row, Rune ch)
 		{
 		{
+			if (col < driver.Cols && row < driver.Rows && col > 0 && driver.Contents [row, col, 2] == 0
+				&& Rune.ColumnWidth ((char)driver.Contents [row, col - 1, 0]) > 1) {
+
+				driver.Contents [row, col, 1] = driver.GetAttribute ();
+				return;
+			}
 			driver.Move (col, row);
 			driver.Move (col, row);
 			driver.AddRune (ch);
 			driver.AddRune (ch);
 		}
 		}

+ 9 - 4
Terminal.Gui/Core/Toplevel.cs

@@ -582,9 +582,11 @@ namespace Terminal.Gui {
 			}
 			}
 			nx = Math.Max (x, 0);
 			nx = Math.Max (x, 0);
 			nx = nx + top.Frame.Width > l ? Math.Max (l - top.Frame.Width, 0) : nx;
 			nx = nx + top.Frame.Width > l ? Math.Max (l - top.Frame.Width, 0) : nx;
-			SetWidth (top.Frame.Width, out int rWidth);
-			if (rWidth < 0 && nx >= top.Frame.X) {
+			var canChange = SetWidth (top.Frame.Width, out int rWidth);
+			if (canChange && rWidth < 0 && nx >= top.Frame.X) {
 				nx = Math.Max (top.Frame.Right - 2, 0);
 				nx = Math.Max (top.Frame.Right - 2, 0);
+			} else if (rWidth < 0 && nx >= top.Frame.X) {
+				nx = Math.Min (nx + 1, top.Frame.Right - 2);
 			}
 			}
 			//System.Diagnostics.Debug.WriteLine ($"nx:{nx}, rWidth:{rWidth}");
 			//System.Diagnostics.Debug.WriteLine ($"nx:{nx}, rWidth:{rWidth}");
 			bool m, s;
 			bool m, s;
@@ -623,9 +625,11 @@ namespace Terminal.Gui {
 			}
 			}
 			ny = Math.Min (ny, l);
 			ny = Math.Min (ny, l);
 			ny = ny + top.Frame.Height >= l ? Math.Max (l - top.Frame.Height, m ? 1 : 0) : ny;
 			ny = ny + top.Frame.Height >= l ? Math.Max (l - top.Frame.Height, m ? 1 : 0) : ny;
-			SetHeight (top.Frame.Height, out int rHeight);
-			if (rHeight < 0 && ny >= top.Frame.Y) {
+			canChange = SetHeight (top.Frame.Height, out int rHeight);
+			if (canChange && rHeight < 0 && ny >= top.Frame.Y) {
 				ny = Math.Max (top.Frame.Bottom - 2, 0);
 				ny = Math.Max (top.Frame.Bottom - 2, 0);
+			} else if (rHeight < 0 && ny >= top.Frame.Y) {
+				ny = Math.Min (ny + 1, top.Frame.Bottom - 2);
 			}
 			}
 			//System.Diagnostics.Debug.WriteLine ($"ny:{ny}, rHeight:{rHeight}");
 			//System.Diagnostics.Debug.WriteLine ($"ny:{ny}, rHeight:{rHeight}");
 
 
@@ -687,6 +691,7 @@ namespace Terminal.Gui {
 			if (!NeedDisplay.IsEmpty || ChildNeedsDisplay || LayoutNeeded) {
 			if (!NeedDisplay.IsEmpty || ChildNeedsDisplay || LayoutNeeded) {
 				Driver.SetAttribute (GetNormalColor ());
 				Driver.SetAttribute (GetNormalColor ());
 
 
+				Driver.UpdateOffScreen ();
 				// This is the Application.Top. Clear just the region we're being asked to redraw 
 				// This is the Application.Top. Clear just the region we're being asked to redraw 
 				// (the bounds passed to us).
 				// (the bounds passed to us).
 				Clear ();
 				Clear ();

+ 51 - 41
Terminal.Gui/Core/View.cs

@@ -124,8 +124,6 @@ namespace Terminal.Gui {
 		Direction focusDirection;
 		Direction focusDirection;
 		bool autoSize;
 		bool autoSize;
 
 
-		TextFormatter textFormatter;
-
 		ShortcutHelper shortcutHelper;
 		ShortcutHelper shortcutHelper;
 
 
 		/// <summary>
 		/// <summary>
@@ -186,12 +184,12 @@ namespace Terminal.Gui {
 		/// <summary>
 		/// <summary>
 		/// Gets or sets the HotKey defined for this view. A user pressing HotKey on the keyboard while this view has focus will cause the Clicked event to fire.
 		/// Gets or sets the HotKey defined for this view. A user pressing HotKey on the keyboard while this view has focus will cause the Clicked event to fire.
 		/// </summary>
 		/// </summary>
-		public virtual Key HotKey { get => textFormatter.HotKey; set => textFormatter.HotKey = value; }
+		public virtual Key HotKey { get => TextFormatter.HotKey; set => TextFormatter.HotKey = value; }
 
 
 		/// <summary>
 		/// <summary>
 		/// Gets or sets the specifier character for the hotkey (e.g. '_'). Set to '\xffff' to disable hotkey support for this View instance. The default is '\xffff'. 
 		/// Gets or sets the specifier character for the hotkey (e.g. '_'). Set to '\xffff' to disable hotkey support for this View instance. The default is '\xffff'. 
 		/// </summary>
 		/// </summary>
-		public virtual Rune HotKeySpecifier { get => textFormatter.HotKeySpecifier; set => textFormatter.HotKeySpecifier = value; }
+		public virtual Rune HotKeySpecifier { get => TextFormatter.HotKeySpecifier; set => TextFormatter.HotKeySpecifier = value; }
 
 
 		/// <summary>
 		/// <summary>
 		/// This is the global setting that can be used as a global shortcut to invoke an action if provided.
 		/// This is the global setting that can be used as a global shortcut to invoke an action if provided.
@@ -524,7 +522,7 @@ namespace Terminal.Gui {
 				if (x is Pos.PosAbsolute) {
 				if (x is Pos.PosAbsolute) {
 					frame = new Rect (x.Anchor (0), frame.Y, frame.Width, frame.Height);
 					frame = new Rect (x.Anchor (0), frame.Y, frame.Width, frame.Height);
 				}
 				}
-				textFormatter.Size = frame.Size;
+				TextFormatter.Size = frame.Size;
 				SetNeedsDisplay (frame);
 				SetNeedsDisplay (frame);
 			}
 			}
 		}
 		}
@@ -548,7 +546,7 @@ namespace Terminal.Gui {
 				if (y is Pos.PosAbsolute) {
 				if (y is Pos.PosAbsolute) {
 					frame = new Rect (frame.X, y.Anchor (0), frame.Width, frame.Height);
 					frame = new Rect (frame.X, y.Anchor (0), frame.Width, frame.Height);
 				}
 				}
-				textFormatter.Size = frame.Size;
+				TextFormatter.Size = frame.Size;
 				SetNeedsDisplay (frame);
 				SetNeedsDisplay (frame);
 			}
 			}
 		}
 		}
@@ -570,11 +568,14 @@ namespace Terminal.Gui {
 				}
 				}
 
 
 				width = value;
 				width = value;
+				if (autoSize && value.Anchor (0) != TextFormatter.Size.Width) {
+					autoSize = false;
+				}
 				SetNeedsLayout ();
 				SetNeedsLayout ();
 				if (width is Dim.DimAbsolute) {
 				if (width is Dim.DimAbsolute) {
 					frame = new Rect (frame.X, frame.Y, width.Anchor (0), frame.Height);
 					frame = new Rect (frame.X, frame.Y, width.Anchor (0), frame.Height);
 				}
 				}
-				textFormatter.Size = frame.Size;
+				TextFormatter.Size = frame.Size;
 				SetNeedsDisplay (frame);
 				SetNeedsDisplay (frame);
 			}
 			}
 		}
 		}
@@ -592,11 +593,14 @@ namespace Terminal.Gui {
 				}
 				}
 
 
 				height = value;
 				height = value;
+				if (autoSize && value.Anchor (0) != TextFormatter.Size.Height) {
+					autoSize = false;
+				}
 				SetNeedsLayout ();
 				SetNeedsLayout ();
 				if (height is Dim.DimAbsolute) {
 				if (height is Dim.DimAbsolute) {
 					frame = new Rect (frame.X, frame.Y, frame.Width, height.Anchor (0));
 					frame = new Rect (frame.X, frame.Y, frame.Width, height.Anchor (0));
 				}
 				}
-				textFormatter.Size = frame.Size;
+				TextFormatter.Size = frame.Size;
 				SetNeedsDisplay (frame);
 				SetNeedsDisplay (frame);
 			}
 			}
 		}
 		}
@@ -614,6 +618,11 @@ namespace Terminal.Gui {
 			return false;
 			return false;
 		}
 		}
 
 
+		/// <summary>
+		/// Gets or sets the <see cref="Terminal.Gui.TextFormatter"/> which can be handled differently by any derived class.
+		/// </summary>
+		public TextFormatter TextFormatter { get; set; }
+
 		/// <summary>
 		/// <summary>
 		/// Returns the container for this view, or null if this view has not been added to a container.
 		/// Returns the container for this view, or null if this view has not been added to a container.
 		/// </summary>
 		/// </summary>
@@ -717,8 +726,8 @@ namespace Terminal.Gui {
 		void Initialize (ustring text, Rect rect, LayoutStyle layoutStyle = LayoutStyle.Computed,
 		void Initialize (ustring text, Rect rect, LayoutStyle layoutStyle = LayoutStyle.Computed,
 			TextDirection direction = TextDirection.LeftRight_TopBottom, Border border = null)
 			TextDirection direction = TextDirection.LeftRight_TopBottom, Border border = null)
 		{
 		{
-			textFormatter = new TextFormatter ();
-			textFormatter.HotKeyChanged += TextFormatter_HotKeyChanged;
+			TextFormatter = new TextFormatter ();
+			TextFormatter.HotKeyChanged += TextFormatter_HotKeyChanged;
 			TextDirection = direction;
 			TextDirection = direction;
 			Border = border;
 			Border = border;
 			if (Border != null) {
 			if (Border != null) {
@@ -772,7 +781,7 @@ namespace Terminal.Gui {
 			foreach (var view in Subviews) {
 			foreach (var view in Subviews) {
 				view.SetNeedsLayout ();
 				view.SetNeedsLayout ();
 			}
 			}
-			textFormatter.NeedsFormat = true;
+			TextFormatter.NeedsFormat = true;
 		}
 		}
 
 
 		/// <summary>
 		/// <summary>
@@ -1013,7 +1022,7 @@ namespace Terminal.Gui {
 			for (int line = 0; line < h; line++) {
 			for (int line = 0; line < h; line++) {
 				Move (0, line);
 				Move (0, line);
 				for (int col = 0; col < w; col++)
 				for (int col = 0; col < w; col++)
-					Driver.AddRune (' ');
+					Driver.AddStr (" ");
 			}
 			}
 		}
 		}
 
 
@@ -1209,7 +1218,7 @@ namespace Terminal.Gui {
 				focused.PositionCursor ();
 				focused.PositionCursor ();
 			} else {
 			} else {
 				if (CanFocus && HasFocus && Visible && Frame.Width > 0 && Frame.Height > 0) {
 				if (CanFocus && HasFocus && Visible && Frame.Width > 0 && Frame.Height > 0) {
-					Move (textFormatter.HotKeyPos == -1 ? 0 : textFormatter.CursorPosition, 0);
+					Move (TextFormatter.HotKeyPos == -1 ? 0 : TextFormatter.CursorPosition, 0);
 				} else {
 				} else {
 					Move (frame.X, frame.Y);
 					Move (frame.X, frame.Y);
 				}
 				}
@@ -1411,11 +1420,12 @@ namespace Terminal.Gui {
 			if (!ustring.IsNullOrEmpty (Text) || (this is Label && !AutoSize)) {
 			if (!ustring.IsNullOrEmpty (Text) || (this is Label && !AutoSize)) {
 				Clear ();
 				Clear ();
 				// Draw any Text
 				// Draw any Text
-				if (textFormatter != null) {
-					textFormatter.NeedsFormat = true;
+				if (TextFormatter != null) {
+					TextFormatter.NeedsFormat = true;
 				}
 				}
-				textFormatter?.Draw (ViewToScreen (Bounds), HasFocus ? ColorScheme.Focus : GetNormalColor (),
-					HasFocus ? ColorScheme.HotFocus : Enabled ? ColorScheme.HotNormal : ColorScheme.Disabled);
+				TextFormatter?.Draw (ViewToScreen (Bounds), HasFocus ? ColorScheme.Focus : GetNormalColor (),
+					HasFocus ? ColorScheme.HotFocus : Enabled ? ColorScheme.HotNormal : ColorScheme.Disabled,
+					SuperView == null ? default : SuperView.ViewToScreen (SuperView.Bounds));
 			}
 			}
 
 
 			// Invoke DrawContentEvent
 			// Invoke DrawContentEvent
@@ -1728,7 +1738,7 @@ namespace Terminal.Gui {
 		/// </summary>
 		/// </summary>
 		/// <param name="command">The command to search.</param>
 		/// <param name="command">The command to search.</param>
 		/// <returns>The <see cref="Key"/> used by a <see cref="Command"/></returns>
 		/// <returns>The <see cref="Key"/> used by a <see cref="Command"/></returns>
-		public Key GetKeyFromCommand(Command command)
+		public Key GetKeyFromCommand (Command command)
 		{
 		{
 			return KeyBindings.First (x => x.Value == command).Key;
 			return KeyBindings.First (x => x.Value == command).Key;
 		}
 		}
@@ -2162,7 +2172,7 @@ namespace Terminal.Gui {
 			Rect oldBounds = Bounds;
 			Rect oldBounds = Bounds;
 			OnLayoutStarted (new LayoutEventArgs () { OldBounds = oldBounds });
 			OnLayoutStarted (new LayoutEventArgs () { OldBounds = oldBounds });
 
 
-			textFormatter.Size = Bounds.Size;
+			TextFormatter.Size = Bounds.Size;
 
 
 
 
 			// Sort out the dependencies of the X, Y, Width, Height properties
 			// Sort out the dependencies of the X, Y, Width, Height properties
@@ -2263,15 +2273,15 @@ namespace Terminal.Gui {
 		/// </para>
 		/// </para>
 		/// </remarks>
 		/// </remarks>
 		public virtual ustring Text {
 		public virtual ustring Text {
-			get => textFormatter.Text;
+			get => TextFormatter.Text;
 			set {
 			set {
-				textFormatter.Text = value;
+				TextFormatter.Text = value;
 				var prevSize = frame.Size;
 				var prevSize = frame.Size;
 				var canResize = ResizeView (autoSize);
 				var canResize = ResizeView (autoSize);
-				if (canResize && textFormatter.Size != Bounds.Size) {
-					Bounds = new Rect (new Point (Bounds.X, Bounds.Y), textFormatter.Size);
-				} else if (!canResize && textFormatter.Size != Bounds.Size) {
-					textFormatter.Size = Bounds.Size;
+				if (canResize && TextFormatter.Size != Bounds.Size) {
+					Bounds = new Rect (new Point (Bounds.X, Bounds.Y), TextFormatter.Size);
+				} else if (!canResize && TextFormatter.Size != Bounds.Size) {
+					TextFormatter.Size = Bounds.Size;
 				}
 				}
 				SetNeedsLayout ();
 				SetNeedsLayout ();
 				SetNeedsDisplay (new Rect (new Point (0, 0),
 				SetNeedsDisplay (new Rect (new Point (0, 0),
@@ -2289,10 +2299,10 @@ namespace Terminal.Gui {
 			get => autoSize;
 			get => autoSize;
 			set {
 			set {
 				var v = ResizeView (value);
 				var v = ResizeView (value);
-				textFormatter.AutoSize = v;
+				TextFormatter.AutoSize = v;
 				if (autoSize != v) {
 				if (autoSize != v) {
 					autoSize = v;
 					autoSize = v;
-					textFormatter.NeedsFormat = true;
+					TextFormatter.NeedsFormat = true;
 					SetNeedsLayout ();
 					SetNeedsLayout ();
 					SetNeedsDisplay ();
 					SetNeedsDisplay ();
 				}
 				}
@@ -2304,9 +2314,9 @@ namespace Terminal.Gui {
 		/// </summary>
 		/// </summary>
 		/// <value>The text alignment.</value>
 		/// <value>The text alignment.</value>
 		public virtual TextAlignment TextAlignment {
 		public virtual TextAlignment TextAlignment {
-			get => textFormatter.Alignment;
+			get => TextFormatter.Alignment;
 			set {
 			set {
-				textFormatter.Alignment = value;
+				TextFormatter.Alignment = value;
 				SetNeedsDisplay ();
 				SetNeedsDisplay ();
 			}
 			}
 		}
 		}
@@ -2316,9 +2326,9 @@ namespace Terminal.Gui {
 		/// </summary>
 		/// </summary>
 		/// <value>The text alignment.</value>
 		/// <value>The text alignment.</value>
 		public virtual VerticalTextAlignment VerticalTextAlignment {
 		public virtual VerticalTextAlignment VerticalTextAlignment {
-			get => textFormatter.VerticalAlignment;
+			get => TextFormatter.VerticalAlignment;
 			set {
 			set {
-				textFormatter.VerticalAlignment = value;
+				TextFormatter.VerticalAlignment = value;
 				SetNeedsDisplay ();
 				SetNeedsDisplay ();
 			}
 			}
 		}
 		}
@@ -2328,17 +2338,17 @@ namespace Terminal.Gui {
 		/// </summary>
 		/// </summary>
 		/// <value>The text alignment.</value>
 		/// <value>The text alignment.</value>
 		public virtual TextDirection TextDirection {
 		public virtual TextDirection TextDirection {
-			get => textFormatter.Direction;
+			get => TextFormatter.Direction;
 			set {
 			set {
-				if (textFormatter.Direction != value) {
-					textFormatter.Direction = value;
-					if (IsInitialized && AutoSize) {
+				if (TextFormatter.Direction != value) {
+					TextFormatter.Direction = value;
+					if (AutoSize) {
 						ResizeView (true);
 						ResizeView (true);
 					} else if (IsInitialized) {
 					} else if (IsInitialized) {
 						var b = new Rect (Bounds.X, Bounds.Y, Bounds.Height, Bounds.Width);
 						var b = new Rect (Bounds.X, Bounds.Y, Bounds.Height, Bounds.Width);
 						SetWidthHeight (b);
 						SetWidthHeight (b);
 					}
 					}
-					textFormatter.Size = Bounds.Size;
+					TextFormatter.Size = Bounds.Size;
 					SetNeedsDisplay ();
 					SetNeedsDisplay ();
 				}
 				}
 			}
 			}
@@ -2423,11 +2433,11 @@ namespace Terminal.Gui {
 			}
 			}
 
 
 			var aSize = autoSize;
 			var aSize = autoSize;
-			Rect nBounds = TextFormatter.CalcRect (Bounds.X, Bounds.Y, Text, textFormatter.Direction);
-			if (textFormatter.Size != nBounds.Size) {
-				textFormatter.Size = nBounds.Size;
+			Rect nBounds = TextFormatter.CalcRect (Bounds.X, Bounds.Y, Text, TextFormatter.Direction);
+			if (TextFormatter.Size != nBounds.Size) {
+				TextFormatter.Size = nBounds.Size;
 			}
 			}
-			if ((textFormatter.Size != Bounds.Size || textFormatter.Size != nBounds.Size)
+			if ((TextFormatter.Size != Bounds.Size || TextFormatter.Size != nBounds.Size)
 				&& (((width == null || width is Dim.DimAbsolute) && (Bounds.Width == 0
 				&& (((width == null || width is Dim.DimAbsolute) && (Bounds.Width == 0
 				|| autoSize && Bounds.Width != nBounds.Width))
 				|| autoSize && Bounds.Width != nBounds.Width))
 				|| ((height == null || height is Dim.DimAbsolute) && (Bounds.Height == 0
 				|| ((height == null || height is Dim.DimAbsolute) && (Bounds.Height == 0
@@ -2452,7 +2462,7 @@ namespace Terminal.Gui {
 			}
 			}
 			if (aSize) {
 			if (aSize) {
 				Bounds = new Rect (Bounds.X, Bounds.Y, canSizeW ? rW : Bounds.Width, canSizeH ? rH : Bounds.Height);
 				Bounds = new Rect (Bounds.X, Bounds.Y, canSizeW ? rW : Bounds.Width, canSizeH ? rH : Bounds.Height);
-				textFormatter.Size = Bounds.Size;
+				TextFormatter.Size = Bounds.Size;
 			}
 			}
 
 
 			return aSize;
 			return aSize;

+ 5 - 6
Terminal.Gui/Core/Window.cs

@@ -269,18 +269,16 @@ namespace Terminal.Gui {
 			var scrRect = ViewToScreen (new Rect (0, 0, Frame.Width, Frame.Height));
 			var scrRect = ViewToScreen (new Rect (0, 0, Frame.Width, Frame.Height));
 			//var borderLength = Border.DrawMarginFrame ? 1 : 0;
 			//var borderLength = Border.DrawMarginFrame ? 1 : 0;
 
 
-			// BUGBUG: Why do we draw the frame twice? This call is here to clear the content area, I think. Why not just clear that area?
+			// FIXED: Why do we draw the frame twice? This call is here to clear the content area, I think. Why not just clear that area?
 			if (!NeedDisplay.IsEmpty) {
 			if (!NeedDisplay.IsEmpty) {
 				Driver.SetAttribute (GetNormalColor ());
 				Driver.SetAttribute (GetNormalColor ());
-				//Driver.DrawWindowFrame (scrRect, padding.Left + borderLength, padding.Top + borderLength, padding.Right + borderLength, padding.Bottom + borderLength,
-				//	Border.BorderStyle != BorderStyle.None, fill: true, Border);
-				Border.DrawContent ();
+				Clear ();
 			}
 			}
 			var savedClip = contentView.ClipToBounds ();
 			var savedClip = contentView.ClipToBounds ();
 
 
 			// Redraw our contentView
 			// Redraw our contentView
-			// TODO: smartly constrict contentView.Bounds to just be what intersects with the 'bounds' we were passed
-			contentView.Redraw (contentView.Bounds);
+			// DONE: smartly constrict contentView.Bounds to just be what intersects with the 'bounds' we were passed
+			contentView.Redraw (!NeedDisplay.IsEmpty ? contentView.Bounds : bounds);
 			Driver.Clip = savedClip;
 			Driver.Clip = savedClip;
 
 
 			ClearLayoutNeeded ();
 			ClearLayoutNeeded ();
@@ -289,6 +287,7 @@ namespace Terminal.Gui {
 				Driver.SetAttribute (GetNormalColor ());
 				Driver.SetAttribute (GetNormalColor ());
 				//Driver.DrawWindowFrame (scrRect, padding.Left + borderLength, padding.Top + borderLength, padding.Right + borderLength, padding.Bottom + borderLength,
 				//Driver.DrawWindowFrame (scrRect, padding.Left + borderLength, padding.Top + borderLength, padding.Right + borderLength, padding.Bottom + borderLength,
 				//	Border.BorderStyle != BorderStyle.None, fill: true, Border.BorderStyle);
 				//	Border.BorderStyle != BorderStyle.None, fill: true, Border.BorderStyle);
+				Border.DrawContent (this, false);
 				if (HasFocus)
 				if (HasFocus)
 					Driver.SetAttribute (ColorScheme.HotNormal);
 					Driver.SetAttribute (ColorScheme.HotNormal);
 				Driver.DrawWindowTitle (scrRect, Title, padding.Left, padding.Top, padding.Right, padding.Bottom);
 				Driver.DrawWindowTitle (scrRect, Title, padding.Left, padding.Top, padding.Right, padding.Bottom);

+ 11 - 11
Terminal.Gui/Views/Button.cs

@@ -33,7 +33,6 @@ namespace Terminal.Gui {
 	public class Button : View {
 	public class Button : View {
 		ustring text;
 		ustring text;
 		bool is_default;
 		bool is_default;
-		TextFormatter textFormatter = new TextFormatter ();
 
 
 		/// <summary>
 		/// <summary>
 		///   Initializes a new instance of <see cref="Button"/> using <see cref="LayoutStyle.Computed"/> layout.
 		///   Initializes a new instance of <see cref="Button"/> using <see cref="LayoutStyle.Computed"/> layout.
@@ -178,7 +177,7 @@ namespace Terminal.Gui {
 		public override Rune HotKeySpecifier {
 		public override Rune HotKeySpecifier {
 			get => hotKeySpecifier;
 			get => hotKeySpecifier;
 			set {
 			set {
-				hotKeySpecifier = textFormatter.HotKeySpecifier = value;
+				hotKeySpecifier = TextFormatter.HotKeySpecifier = value;
 			}
 			}
 		}
 		}
 
 
@@ -194,11 +193,11 @@ namespace Terminal.Gui {
 		internal void Update ()
 		internal void Update ()
 		{
 		{
 			if (IsDefault)
 			if (IsDefault)
-				textFormatter.Text = ustring.Make (_leftBracket) + ustring.Make (_leftDefault) + " " + text + " " + ustring.Make (_rightDefault) + ustring.Make (_rightBracket);
+				TextFormatter.Text = ustring.Make (_leftBracket) + ustring.Make (_leftDefault) + " " + text + " " + ustring.Make (_rightDefault) + ustring.Make (_rightBracket);
 			else
 			else
-				textFormatter.Text = ustring.Make (_leftBracket) + " " + text + " " + ustring.Make (_rightBracket);
+				TextFormatter.Text = ustring.Make (_leftBracket) + " " + text + " " + ustring.Make (_rightBracket);
 
 
-			int w = textFormatter.Text.RuneCount - (textFormatter.Text.Contains (HotKeySpecifier) ? 1 : 0);
+			int w = TextFormatter.Size.Width - (TextFormatter.Text.Contains (HotKeySpecifier) ? 1 : 0);
 			GetCurrentWidth (out int cWidth);
 			GetCurrentWidth (out int cWidth);
 			var canSetWidth = SetWidth (w, out int rWidth);
 			var canSetWidth = SetWidth (w, out int rWidth);
 			if (canSetWidth && (cWidth < rWidth || AutoSize)) {
 			if (canSetWidth && (cWidth < rWidth || AutoSize)) {
@@ -233,11 +232,12 @@ namespace Terminal.Gui {
 				Border.DrawContent (this);
 				Border.DrawContent (this);
 			}
 			}
 
 
-			if (!ustring.IsNullOrEmpty (textFormatter.Text)) {
+			if (!ustring.IsNullOrEmpty (TextFormatter.Text)) {
 				Clear ();
 				Clear ();
-				textFormatter.NeedsFormat = true;
-				textFormatter?.Draw (ViewToScreen (Bounds), HasFocus ? ColorScheme.Focus : GetNormalColor (),
-					HasFocus ? ColorScheme.HotFocus : Enabled ? ColorScheme.HotNormal : ColorScheme.Disabled);
+				TextFormatter.NeedsFormat = true;
+				TextFormatter?.Draw (ViewToScreen (Bounds), HasFocus ? ColorScheme.Focus : GetNormalColor (),
+					HasFocus ? ColorScheme.HotFocus : Enabled ? ColorScheme.HotNormal : ColorScheme.Disabled,
+					SuperView == null ? default : SuperView.ViewToScreen (SuperView.Bounds));
 			}
 			}
 		}
 		}
 
 
@@ -341,8 +341,8 @@ namespace Terminal.Gui {
 		public override void PositionCursor ()
 		public override void PositionCursor ()
 		{
 		{
 			if (HotKey == Key.Unknown && text != "") {
 			if (HotKey == Key.Unknown && text != "") {
-				for (int i = 0; i < textFormatter.Text.RuneCount; i++) {
-					if (textFormatter.Text [i] == text [0]) {
+				for (int i = 0; i < TextFormatter.Text.RuneCount; i++) {
+					if (TextFormatter.Text [i] == text [0]) {
 						Move (i, 0);
 						Move (i, 0);
 						return;
 						return;
 					}
 					}

+ 3 - 2
Terminal.Gui/Views/FrameView.cs

@@ -216,17 +216,18 @@ namespace Terminal.Gui {
 			if (!NeedDisplay.IsEmpty) {
 			if (!NeedDisplay.IsEmpty) {
 				Driver.SetAttribute (GetNormalColor ());
 				Driver.SetAttribute (GetNormalColor ());
 				//Driver.DrawWindowFrame (scrRect, padding + 1, padding + 1, padding + 1, padding + 1, border: true, fill: true);
 				//Driver.DrawWindowFrame (scrRect, padding + 1, padding + 1, padding + 1, padding + 1, border: true, fill: true);
-				Border.DrawContent ();
+				Clear ();
 			}
 			}
 
 
 			var savedClip = contentView.ClipToBounds ();
 			var savedClip = contentView.ClipToBounds ();
-			contentView.Redraw (contentView.Bounds);
+			contentView.Redraw (!NeedDisplay.IsEmpty ? contentView.Bounds : bounds);
 			Driver.Clip = savedClip;
 			Driver.Clip = savedClip;
 
 
 			ClearNeedsDisplay ();
 			ClearNeedsDisplay ();
 			if (Border.BorderStyle != BorderStyle.None) {
 			if (Border.BorderStyle != BorderStyle.None) {
 				Driver.SetAttribute (GetNormalColor ());
 				Driver.SetAttribute (GetNormalColor ());
 				//Driver.DrawWindowFrame (scrRect, padding + 1, padding + 1, padding + 1, padding + 1, border: true, fill: false);
 				//Driver.DrawWindowFrame (scrRect, padding + 1, padding + 1, padding + 1, padding + 1, border: true, fill: false);
+				Border.DrawContent (this, false);
 				if (HasFocus)
 				if (HasFocus)
 					Driver.SetAttribute (ColorScheme.HotNormal);
 					Driver.SetAttribute (ColorScheme.HotNormal);
 				//Driver.DrawWindowTitle (scrRect, Title, padding, padding, padding, padding);
 				//Driver.DrawWindowTitle (scrRect, Title, padding, padding, padding, padding);

+ 12 - 10
Terminal.Gui/Views/Label.cs

@@ -27,37 +27,39 @@ namespace Terminal.Gui {
 		}
 		}
 
 
 		/// <inheritdoc/>
 		/// <inheritdoc/>
-		public Label (Rect frame) : base (frame)
+		public Label (Rect frame, bool autosize = false) : base (frame)
 		{
 		{
+			Initialize (autosize);
 		}
 		}
 
 
 		/// <inheritdoc/>
 		/// <inheritdoc/>
-		public Label (ustring text) : base (text)
+		public Label (ustring text, bool autosize = true) : base (text)
 		{
 		{
-			Initialize ();
+			Initialize (autosize);
 		}
 		}
 
 
 		/// <inheritdoc/>
 		/// <inheritdoc/>
-		public Label (Rect rect, ustring text) : base (rect, text)
+		public Label (Rect rect, ustring text, bool autosize = false) : base (rect, text)
 		{
 		{
+			Initialize (autosize);
 		}
 		}
 
 
 		/// <inheritdoc/>
 		/// <inheritdoc/>
-		public Label (int x, int y, ustring text) : base (x, y, text)
+		public Label (int x, int y, ustring text, bool autosize = true) : base (x, y, text)
 		{
 		{
-			Initialize ();
+			Initialize (autosize);
 		}
 		}
 
 
 		/// <inheritdoc/>
 		/// <inheritdoc/>
-		public Label (ustring text, TextDirection direction)
+		public Label (ustring text, TextDirection direction, bool autosize = true)
 			: base (text, direction)
 			: base (text, direction)
 		{
 		{
-			Initialize ();
+			Initialize (autosize);
 		}
 		}
 
 
-		void Initialize ()
+		void Initialize (bool autosize = true)
 		{
 		{
-			AutoSize = true;
+			AutoSize = autosize;
 		}
 		}
 
 
 		/// <summary>
 		/// <summary>

+ 2 - 1
Terminal.Gui/Views/Menu.cs

@@ -514,7 +514,8 @@ namespace Terminal.Gui {
 						};
 						};
 						tf.Draw (ViewToScreen (new Rect (2, i + 1, Frame.Width - 3, 1)),
 						tf.Draw (ViewToScreen (new Rect (2, i + 1, Frame.Width - 3, 1)),
 							i == current ? ColorScheme.Focus : GetNormalColor (),
 							i == current ? ColorScheme.Focus : GetNormalColor (),
-							i == current ? ColorScheme.HotFocus : ColorScheme.HotNormal);
+							i == current ? ColorScheme.HotFocus : ColorScheme.HotNormal,
+							SuperView == null ? default : SuperView.ViewToScreen (SuperView.Bounds));
 					} else {
 					} else {
 						DrawHotString (textToDraw,
 						DrawHotString (textToDraw,
 							i == current ? ColorScheme.HotFocus : ColorScheme.HotNormal,
 							i == current ? ColorScheme.HotFocus : ColorScheme.HotNormal,

+ 2 - 1
Terminal.Gui/Views/ProgressBar.cs

@@ -335,7 +335,8 @@ namespace Terminal.Gui {
 					? 2 : 1);
 					? 2 : 1);
 				Move (padding, row);
 				Move (padding, row);
 				var rect = new Rect (padding, row, fWidth, Frame.Height);
 				var rect = new Rect (padding, row, fWidth, Frame.Height);
-				tf?.Draw (ViewToScreen (rect), ColorScheme.HotNormal, ColorScheme.HotNormal);
+				tf?.Draw (ViewToScreen (rect), ColorScheme.HotNormal, ColorScheme.HotNormal,
+					SuperView == null ? default : SuperView.ViewToScreen (SuperView.Bounds));
 				break;
 				break;
 			}
 			}
 		}
 		}

+ 4 - 1
Terminal.Gui/Views/TextField.cs

@@ -374,7 +374,10 @@ namespace Terminal.Gui {
 			}
 			}
 			var pos = point - first + Math.Min (Frame.X, 0);
 			var pos = point - first + Math.Min (Frame.X, 0);
 			var offB = OffSetBackground ();
 			var offB = OffSetBackground ();
-			if (pos > -1 && col >= pos && pos < Frame.Width + offB) {
+			var containerFrame = SuperView?.ViewToScreen (SuperView.Bounds) ?? default;
+			var thisFrame = ViewToScreen (Bounds);
+			if (pos > -1 && col >= pos && pos < Frame.Width + offB
+				&& containerFrame.IntersectsWith (thisFrame)) {
 				RestoreCursorVisibility ();
 				RestoreCursorVisibility ();
 				Move (col, 0);
 				Move (col, 0);
 			} else {
 			} else {

+ 2 - 2
UICatalog/Scenarios/Borders.cs

@@ -36,8 +36,8 @@ namespace UICatalog.Scenarios {
 			smartPanel.Add (new Label () { // Or smartPanel.Child = 
 			smartPanel.Add (new Label () { // Or smartPanel.Child = 
 				X = 0,
 				X = 0,
 				Y = 0,
 				Y = 0,
-				Width = 24,
-				Height = 13,
+				//Width = 24, commenting because now setting the size disable auto-size
+				//Height = 13,
 				ColorScheme = Colors.TopLevel,
 				ColorScheme = Colors.TopLevel,
 				Text = "This is a test\nwith a \nPanelView",
 				Text = "This is a test\nwith a \nPanelView",
 				TextAlignment = TextAlignment.Centered
 				TextAlignment = TextAlignment.Centered

+ 3 - 3
UICatalog/Scenarios/ComputedLayout.cs

@@ -39,7 +39,7 @@ namespace UICatalog.Scenarios {
 			var horizontalRuler = new Label ("") {
 			var horizontalRuler = new Label ("") {
 				X = 0,
 				X = 0,
 				Y = 0,
 				Y = 0,
-				Width = Dim.Fill (1),  // BUGBUG: I don't think this should be needed; DimFill() should respect container's frame. X does.
+				Width = Dim.Fill (),  // FIXED: I don't think this should be needed; DimFill() should respect container's frame. X does.
 				ColorScheme = Colors.Error
 				ColorScheme = Colors.Error
 			};
 			};
 
 
@@ -143,14 +143,14 @@ namespace UICatalog.Scenarios {
 				ColorScheme = Colors.Menu,
 				ColorScheme = Colors.Menu,
 				Width = Dim.Fill (),
 				Width = Dim.Fill (),
 				X = Pos.Center (),
 				X = Pos.Center (),
-				Y = Pos.Bottom (Win) - 4  // BUGBUG: -2 should be two lines above border; but it has to be -4
+				Y = Pos.AnchorEnd () - 2 // FIXED: -2 should be two lines above border; but it has to be -4
 			};
 			};
 			Win.Add (bottomLabel);
 			Win.Add (bottomLabel);
 
 
 			// Show positioning vertically using Pos.Bottom 
 			// Show positioning vertically using Pos.Bottom 
 			// BUGBUG: -1 should be just above border; but it has to be -3
 			// BUGBUG: -1 should be just above border; but it has to be -3
 			var leftButton = new Button ("Left") {
 			var leftButton = new Button ("Left") {
-				Y = Pos.Bottom (Win) - 3
+				Y = Pos.AnchorEnd () - 1
 			};
 			};
 			leftButton.Clicked += () => {
 			leftButton.Clicked += () => {
 				// Ths demonstrates how to have a dynamically sized button
 				// Ths demonstrates how to have a dynamically sized button

+ 141 - 1
UnitTests/PanelViewTests.cs

@@ -4,9 +4,17 @@ using System.Linq;
 using System.Text;
 using System.Text;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
 using Xunit;
 using Xunit;
+using Xunit.Abstractions;
 
 
 namespace Terminal.Gui.Views {
 namespace Terminal.Gui.Views {
 	public class PanelViewTests {
 	public class PanelViewTests {
+		readonly ITestOutputHelper output;
+
+		public PanelViewTests (ITestOutputHelper output)
+		{
+			this.output = output;
+		}
+
 		[Fact]
 		[Fact]
 		public void Constructor_Defaults ()
 		public void Constructor_Defaults ()
 		{
 		{
@@ -32,7 +40,7 @@ namespace Terminal.Gui.Views {
 		{
 		{
 			var pv = new PanelView (new Label ("This is a test."));
 			var pv = new PanelView (new Label ("This is a test."));
 			Assert.NotNull (pv.Child);
 			Assert.NotNull (pv.Child);
-			Assert.Equal (1, pv.Subviews[0].Subviews.Count);
+			Assert.Equal (1, pv.Subviews [0].Subviews.Count);
 
 
 			pv.Child = null;
 			pv.Child = null;
 			Assert.Null (pv.Child);
 			Assert.Null (pv.Child);
@@ -331,5 +339,137 @@ namespace Terminal.Gui.Views {
 			Assert.Equal (new Rect (3, 5, 20, 10), pv1.Frame);
 			Assert.Equal (new Rect (3, 5, 20, 10), pv1.Frame);
 			Assert.Equal (new Rect (5, 6, 15, 4), pv1.Child.Frame);
 			Assert.Equal (new Rect (5, 6, 15, 4), pv1.Child.Frame);
 		}
 		}
+
+		[Fact, AutoInitShutdown]
+		public void Setting_Child_Size_Disable_AutoSize ()
+		{
+			var top = Application.Top;
+			var win = new Window ();
+			var label = new Label ("Hello World") {
+				Width = 24,
+				Height = 13,
+				ColorScheme = Colors.TopLevel,
+				Text = "This is a test\nwith a \nPanelView",
+				TextAlignment = TextAlignment.Centered
+			};
+			var pv = new PanelView (label) {
+				Width = 24,
+				Height = 13,
+				Border = new Border () {
+					BorderStyle = BorderStyle.Single,
+					DrawMarginFrame = true,
+					BorderThickness = new Thickness (2),
+					BorderBrush = Color.Red,
+					Padding = new Thickness (2),
+					Background = Color.BrightGreen,
+					Effect3D = true
+				},
+			};
+			win.Add (pv);
+			top.Add (win);
+
+			Application.Begin (top);
+
+			Assert.Equal (new Rect (0, 0, 24, 13), label.Frame);
+			Assert.Equal (new Rect (0, 0, 34, 23), pv.Frame);
+			Assert.Equal (new Rect (0, 0, 80, 25), win.Frame);
+			Assert.Equal (new Rect (0, 0, 80, 25), Application.Top.Frame);
+
+			var expected = @"
+┌──────────────────────────────────────────────────────────────────────────────┐
+│                                                                              │
+│                                                                              │
+│                                                                              │
+│                                                                              │
+│    ┌────────────────────────┐                                                │
+│    │     This is a test     │                                                │
+│    │        with a          │                                                │
+│    │       PanelView        │                                                │
+│    │                        │                                                │
+│    │                        │                                                │
+│    │                        │                                                │
+│    │                        │                                                │
+│    │                        │                                                │
+│    │                        │                                                │
+│    │                        │                                                │
+│    │                        │                                                │
+│    │                        │                                                │
+│    │                        │                                                │
+│    └────────────────────────┘                                                │
+│                                                                              │
+│                                                                              │
+│                                                                              │
+│                                                                              │
+└──────────────────────────────────────────────────────────────────────────────┘
+";
+
+			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			Assert.Equal (new Rect (0, 0, 80, 25), pos);
+		}
+
+		[Fact, AutoInitShutdown]
+		public void Not_Setting_Child_Size_Default_AutoSize_True ()
+		{
+			var top = Application.Top;
+			var win = new Window ();
+			var label = new Label ("Hello World") {
+				ColorScheme = Colors.TopLevel,
+				Text = "This is a test\nwith a \nPanelView",
+				TextAlignment = TextAlignment.Centered
+			};
+			var pv = new PanelView (label) {
+				Width = 24,
+				Height = 13,
+				Border = new Border () {
+					BorderStyle = BorderStyle.Single,
+					DrawMarginFrame = true,
+					BorderThickness = new Thickness (2),
+					BorderBrush = Color.Red,
+					Padding = new Thickness (2),
+					Background = Color.BrightGreen,
+					Effect3D = true
+				},
+			};
+			win.Add (pv);
+			top.Add (win);
+
+			Application.Begin (top);
+
+			Assert.Equal (new Rect (0, 0, 14, 3), label.Frame);
+			Assert.Equal (new Rect (0, 0, 24, 13), pv.Frame);
+			Assert.Equal (new Rect (0, 0, 80, 25), win.Frame);
+			Assert.Equal (new Rect (0, 0, 80, 25), Application.Top.Frame);
+
+			var expected = @"
+┌──────────────────────────────────────────────────────────────────────────────┐
+│                                                                              │
+│                                                                              │
+│                                                                              │
+│                                                                              │
+│    ┌──────────────┐                                                          │
+│    │This is a test│                                                          │
+│    │   with a     │                                                          │
+│    │  PanelView   │                                                          │
+│    └──────────────┘                                                          │
+│                                                                              │
+│                                                                              │
+│                                                                              │
+│                                                                              │
+│                                                                              │
+│                                                                              │
+│                                                                              │
+│                                                                              │
+│                                                                              │
+│                                                                              │
+│                                                                              │
+│                                                                              │
+│                                                                              │
+│                                                                              │
+└──────────────────────────────────────────────────────────────────────────────┘
+";
+
+			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			Assert.Equal (new Rect (0, 0, 80, 25), pos);
+		}
 	}
 	}
 }
 }

+ 54 - 0
UnitTests/ViewTests.cs

@@ -1338,6 +1338,60 @@ namespace Terminal.Gui.Core {
 			Assert.Equal ("{X=0,Y=0,Width=28,Height=2}", label.Bounds.ToString ());
 			Assert.Equal ("{X=0,Y=0,Width=28,Height=2}", label.Bounds.ToString ());
 		}
 		}
 
 
+		[Fact, AutoInitShutdown]
+		public void AutoSize_True_Setting_With_Height_Sets_AutoSize_False_Horizontal ()
+		{
+			var label = new Label ("Hello") { Width = 10, Height = 2 };
+			var viewX = new View ("X") { X = Pos.Right (label) };
+			var viewY = new View ("Y") { Y = Pos.Bottom (label) };
+
+			Application.Top.Add (label, viewX, viewY);
+			Application.Begin (Application.Top);
+
+			Assert.False (label.AutoSize);
+			Assert.Equal (new Rect (0, 0, 10, 2), label.Frame);
+
+			var expected = @"
+Hello     X
+
+Y
+";
+
+			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			Assert.Equal (new Rect (0, 0, 11, 3), pos);
+		}
+
+		[Fact, AutoInitShutdown]
+		public void AutoSize_True_Setting_With_Height_Sets_AutoSize_False_Vertical ()
+		{
+			var label = new Label ("Hello") { Width = 2, Height = 10, TextDirection = TextDirection.TopBottom_LeftRight };
+			var viewX = new View ("X") { X = Pos.Right (label) };
+			var viewY = new View ("Y") { Y = Pos.Bottom (label) };
+
+			Application.Top.Add (label, viewX, viewY);
+			Application.Begin (Application.Top);
+
+			Assert.False (label.AutoSize);
+			Assert.Equal (new Rect (0, 0, 2, 10), label.Frame);
+
+			var expected = @"
+H X
+e
+l
+l
+o
+
+
+
+
+
+Y
+";
+
+			var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
+			Assert.Equal (new Rect (0, 0, 3, 11), pos);
+		}
+
 		[Theory]
 		[Theory]
 		[InlineData (1)]
 		[InlineData (1)]
 		[InlineData (2)]
 		[InlineData (2)]