浏览代码

Stage 1 of #3256 - Prepare Rect for removal (#3260)

* Replace all 342 `== null` with `is null`

* Replace 354 `!= null` with `is { }`

* Wrap these in conditionals since they break tests against Release configuration

The members they depend on do not exist in Release configuration

* Split these up and dispose properly

This test needs to be revisited for several reasons at some point.

* Fix release configuration tests

* Declare interface these already support

* Annotate constructor properly and use throw helper

* Move class to its own file

* Rename these files so they nest in the solution explorer

* Make this a record type and remove now-redundant/illegal members

* Reference passing to avoid some struct copies

* Simplify this

* Carry reference passing through as appropriate

* Turn this into a record struct

* Remove unused internal constructor and its test

It was only used by that test.

* Simplify this constructor

* This should be a property

* Simplify constructor

* Simplify GetHashCode

* Mark this ignored just in case

* Missed a couple of opportunities for reference passing

* record struct already does this by value

* Remove unused class

* Simplify the type initializer and Reset method

* Implement INotifyCollectionChanged and IDictionary by delegating to ColorSchemes

* Fix for reflection-based configuration

* Make CI  build happy by disambiguiating this attribute

* Add PERF, NOTE, QUESTION, and CONCURRENCY tags for the todo explorer

* Make this string comparison faster.

* Add a tag for unclear intent

* This is a constant

* Turn this into a constant via use of a unicode literal

* Remove this method and its test

It is unused
There's no guarantee at all that the parent process is the terminal.
There are good reasons, including that one, why there's no simple way to do it in .net.
It's also of course a windows-only thing, if using WMI.

* With the WMI method gone, we no longer need this

* Make this more efficient

* Add detail to this property's XmlDoc

* Move the general properties up top because order matters

* Make sure any constants defined at higher levels are not clobbered and define a couple more

* Put InternalsVisibleTo in its own group

* Sort dependencies alphabetically and update

* Global usings

* Split to one type per file

* Collection expression

* Fix naming

* Inline to avoid copies

* This is already a value copy (struct)

* Combine to one non-destructive mutation

* Avoid some potential boxing

* Turn on null analysis here

* Remove unnecessary cast and use real type name

* Seal this

* Fix name

* Move nested class to a nested file (no type layout change made)

* Undo naming change that isn't changed globally until next batch

* Rename Rect to Rectangle in preparation for removal

* Add baseline test for ToString checking for current behavior.

* Change to behavior matching System.Drawing.Rectangle

* Fix this test

This is not a test of Rectangle, so trust that Rectangle gets it right.

* Fix these tests the same way as the previous commit

* These should be testing against the Rectangles, not the strings

* Slightly de-couple these as well

* Test against Rectangles, not strings

* Collection expressions and constants

* Remove this

* Perform proper platform-agnostic normalization

* Make this easier to follow (naming only)

* Add a category to this

* Use raw strings for better clarity

* Some more categorization

* Re-apply backed-out naming change from parent branch

* Change GetHashCode to be equivalent to System.Drawing.Rectangle

* Update this since 6.0.0 is no longer available and prevents build

* This check is redundant with the rectangle check below

* Re-apply Rect->Rectangle name changes in these files
dodexahedron 1 年之前
父节点
当前提交
0f9e6f091d
共有 100 个文件被更改,包括 1435 次插入1338 次删除
  1. 4 4
      Terminal.Gui/Application.cs
  2. 6 6
      Terminal.Gui/ConsoleDrivers/ConsoleDriver.cs
  3. 1 1
      Terminal.Gui/ConsoleDrivers/FakeDriver/FakeDriver.cs
  4. 3 3
      Terminal.Gui/ConsoleDrivers/NetDriver.cs
  5. 2 2
      Terminal.Gui/ConsoleDrivers/WindowsDriver.cs
  6. 9 9
      Terminal.Gui/Drawing/LineCanvas.cs
  7. 2 2
      Terminal.Gui/Drawing/StraightLine.cs
  8. 12 12
      Terminal.Gui/Drawing/Thickness.cs
  9. 1 1
      Terminal.Gui/Text/Autocomplete/PopupAutocomplete.PopUp.cs
  10. 3 3
      Terminal.Gui/Text/Autocomplete/PopupAutocomplete.cs
  11. 9 9
      Terminal.Gui/Text/TextFormatter.cs
  12. 24 21
      Terminal.Gui/Types/Rectangle.cs
  13. 8 8
      Terminal.Gui/Types/RectangleF.cs
  14. 8 8
      Terminal.Gui/View/Adornment/Adornment.cs
  15. 9 9
      Terminal.Gui/View/Adornment/Border.cs
  16. 38 38
      Terminal.Gui/View/Layout/ViewLayout.cs
  17. 1 1
      Terminal.Gui/View/View.cs
  18. 21 21
      Terminal.Gui/View/ViewDrawing.cs
  19. 3 3
      Terminal.Gui/View/ViewEventArgs.cs
  20. 1 1
      Terminal.Gui/View/ViewSubViews.cs
  21. 5 5
      Terminal.Gui/View/ViewText.cs
  22. 3 3
      Terminal.Gui/Views/ColorPicker.cs
  23. 4 4
      Terminal.Gui/Views/ComboBox.cs
  24. 2 2
      Terminal.Gui/Views/FileDialog.cs
  25. 2 2
      Terminal.Gui/Views/GraphView/Annotations.cs
  26. 6 6
      Terminal.Gui/Views/GraphView/Axis.cs
  27. 3 3
      Terminal.Gui/Views/GraphView/GraphView.cs
  28. 4 4
      Terminal.Gui/Views/GraphView/Series.cs
  29. 4 4
      Terminal.Gui/Views/HexView.cs
  30. 2 2
      Terminal.Gui/Views/Line.cs
  31. 1 1
      Terminal.Gui/Views/LineView.cs
  32. 2 2
      Terminal.Gui/Views/ListView.cs
  33. 2 2
      Terminal.Gui/Views/Menu/ContextMenu.cs
  34. 8 8
      Terminal.Gui/Views/Menu/Menu.cs
  35. 4 4
      Terminal.Gui/Views/Menu/MenuBar.cs
  36. 1 1
      Terminal.Gui/Views/MessageBox.cs
  37. 2 2
      Terminal.Gui/Views/ProgressBar.cs
  38. 5 5
      Terminal.Gui/Views/RadioGroup.cs
  39. 1 1
      Terminal.Gui/Views/ScrollBarView.cs
  40. 5 5
      Terminal.Gui/Views/ScrollView.cs
  41. 3 3
      Terminal.Gui/Views/Slider.cs
  42. 1 1
      Terminal.Gui/Views/StatusBar.cs
  43. 8 8
      Terminal.Gui/Views/TabView.cs
  44. 1 1
      Terminal.Gui/Views/TableView/ListTableSource.cs
  45. 4 4
      Terminal.Gui/Views/TableView/TableSelection.cs
  46. 18 18
      Terminal.Gui/Views/TableView/TableView.cs
  47. 3 3
      Terminal.Gui/Views/TextField.cs
  48. 1 1
      Terminal.Gui/Views/TextValidateField.cs
  49. 8 8
      Terminal.Gui/Views/TextView.cs
  50. 5 5
      Terminal.Gui/Views/TileView.cs
  51. 1 1
      Terminal.Gui/Views/Toplevel.cs
  52. 1 1
      Terminal.Gui/Views/TreeView/TreeView.cs
  53. 3 2
      UICatalog/Scenarios/Animation.cs
  54. 2 2
      UICatalog/Scenarios/Buttons.cs
  55. 6 6
      UICatalog/Scenarios/CharacterMap.cs
  56. 1 1
      UICatalog/Scenarios/GraphViewExample.cs
  57. 2 1
      UICatalog/Scenarios/Images.cs
  58. 1 1
      UICatalog/Scenarios/LineDrawing.cs
  59. 1 1
      UICatalog/Scenarios/ProgressBarStyles.cs
  60. 5 5
      UICatalog/Scenarios/Scrolling.cs
  61. 1 1
      UICatalog/Scenarios/SingleBackgroundWorker.cs
  62. 1 1
      UICatalog/Scenarios/Snake.cs
  63. 3 3
      UnitTests/Application/ApplicationTests.cs
  64. 5 5
      UnitTests/ConsoleDrivers/ClipRegionTests.cs
  65. 21 21
      UnitTests/Drawing/LineCanvasTests.cs
  66. 4 4
      UnitTests/Drawing/RulerTests.cs
  67. 1 1
      UnitTests/Drawing/StraightLineTests.cs
  68. 48 48
      UnitTests/Drawing/ThicknessTests.cs
  69. 29 29
      UnitTests/TestHelpers.cs
  70. 21 21
      UnitTests/Text/TextFormatterTests.cs
  71. 89 80
      UnitTests/Types/RectangleTests.cs
  72. 1 1
      UnitTests/UnitTests.csproj
  73. 16 16
      UnitTests/View/Adornment/AdornmentTests.cs
  74. 34 34
      UnitTests/View/Adornment/BorderTests.cs
  75. 231 151
      UnitTests/View/DrawTests.cs
  76. 4 4
      UnitTests/View/FrameTests.cs
  77. 52 52
      UnitTests/View/Layout/AbsoluteLayoutTests.cs
  78. 24 24
      UnitTests/View/Layout/DimTests.cs
  79. 17 17
      UnitTests/View/Layout/LayoutTests.cs
  80. 29 29
      UnitTests/View/Layout/PosTests.cs
  81. 10 10
      UnitTests/View/Layout/SetRelativeLayoutTests.cs
  82. 13 13
      UnitTests/View/NavigationTests.cs
  83. 1 1
      UnitTests/View/SubviewTests.cs
  84. 30 28
      UnitTests/View/Text/AutoSizeFalseTests.cs
  85. 141 135
      UnitTests/View/Text/AutoSizeTrueTests.cs
  86. 71 76
      UnitTests/View/ViewTests.cs
  87. 2 2
      UnitTests/Views/AllViewsTests.cs
  88. 25 25
      UnitTests/Views/ButtonTests.cs
  89. 32 32
      UnitTests/Views/CheckBoxTests.cs
  90. 1 1
      UnitTests/Views/ColorPickerTests.cs
  91. 5 5
      UnitTests/Views/ComboBoxTests.cs
  92. 31 31
      UnitTests/Views/ContextMenuTests.cs
  93. 3 3
      UnitTests/Views/DateFieldTests.cs
  94. 6 6
      UnitTests/Views/FrameViewTests.cs
  95. 34 34
      UnitTests/Views/GraphViewTests.cs
  96. 26 26
      UnitTests/Views/LabelTests.cs
  97. 2 2
      UnitTests/Views/ListViewTests.cs
  98. 42 42
      UnitTests/Views/MenuBarTests.cs
  99. 8 8
      UnitTests/Views/RadioGroupTests.cs
  100. 15 15
      UnitTests/Views/ScrollBarViewTests.cs

+ 4 - 4
Terminal.Gui/Application.cs

@@ -1127,7 +1127,7 @@ public static partial class Application
 
     private static View FindDeepestTop (Toplevel start, int x, int y, out int resx, out int resy)
     {
-        Rect startFrame = start.Frame;
+        Rectangle startFrame = start.Frame;
 
         if (!startFrame.Contains (x, y))
         {
@@ -1286,7 +1286,7 @@ public static partial class Application
 
         foreach (Toplevel t in _topLevels)
         {
-            t.SetRelativeLayout (new Rect (0, 0, args.Size.Width, args.Size.Height));
+            t.SetRelativeLayout (new Rectangle (0, 0, args.Size.Width, args.Size.Height));
             t.LayoutSubviews ();
             t.PositionToplevels ();
             t.OnSizeChanging (new SizeChangedEventArgs (args.Size));
@@ -1424,7 +1424,7 @@ public static partial class Application
     /// <param name="a">The mouse event with coordinates relative to the screen.</param>
     public static void OnMouseEvent (MouseEventEventArgs a)
     {
-        static bool OutsideRect (Point p, Rect r) { return p.X < 0 || p.X > r.Right || p.Y < 0 || p.Y > r.Bottom; }
+        static bool OutsideRect (Point p, Rectangle r) { return p.X < 0 || p.X > r.Right || p.Y < 0 || p.Y > r.Bottom; }
 
         if (IsMouseDisabled)
         {
@@ -1587,7 +1587,7 @@ public static partial class Application
                 return;
             }
 
-            Rect bounds = view.BoundsToScreen (view.Bounds);
+            Rectangle bounds = view.BoundsToScreen (view.Bounds);
 
             if (bounds.Contains (a.MouseEvent.X, a.MouseEvent.Y))
             {

+ 6 - 6
Terminal.Gui/ConsoleDrivers/ConsoleDriver.cs

@@ -39,14 +39,14 @@ public abstract class ConsoleDriver
     internal bool [] _dirtyLines;
 
     /// <summary>Gets the dimensions of the terminal.</summary>
-    public Rect Bounds => new (0, 0, Cols, Rows);
+    public Rectangle Bounds => new (0, 0, Cols, Rows);
 
     /// <summary>
     ///     Gets or sets the clip rectangle that <see cref="AddRune(Rune)"/> and <see cref="AddStr(string)"/> are subject
     ///     to.
     /// </summary>
     /// <value>The rectangle describing the bounds of <see cref="Clip"/>.</value>
-    public Rect Clip { get; set; }
+    public Rectangle Clip { get; set; }
 
     /// <summary>Get the operating system clipboard.</summary>
     public IClipboard Clipboard { get; internal set; }
@@ -320,7 +320,7 @@ public abstract class ConsoleDriver
     {
         // TODO: This method is really "Clear Contents" now and should not be abstract (or virtual)
         Contents = new Cell [Rows, Cols];
-        Clip = new Rect (0, 0, Cols, Rows);
+        Clip = new Rectangle (0, 0, Cols, Rows);
         _dirtyLines = new bool [Rows];
 
         lock (Contents)
@@ -353,7 +353,7 @@ public abstract class ConsoleDriver
     /// <summary>Fills the specified rectangle with the specified rune.</summary>
     /// <param name="rect"></param>
     /// <param name="rune"></param>
-    public void FillRect (Rect rect, Rune rune = default)
+    public void FillRect (Rectangle rect, Rune rune = default)
     {
         for (int r = rect.Y; r < rect.Y + rect.Height; r++)
         {
@@ -367,11 +367,11 @@ public abstract class ConsoleDriver
 
     /// <summary>
     ///     Fills the specified rectangle with the specified <see langword="char"/>. This method is a convenience method
-    ///     that calls <see cref="FillRect(Rect, Rune)"/>.
+    ///     that calls <see cref="FillRect(Rectangle, Rune)"/>.
     /// </summary>
     /// <param name="rect"></param>
     /// <param name="c"></param>
-    public void FillRect (Rect rect, char c) { FillRect (rect, new Rune (c)); }
+    public void FillRect (Rectangle rect, char c) { FillRect (rect, new Rune (c)); }
 
     /// <summary>Gets the terminal cursor visibility.</summary>
     /// <param name="visibility">The current <see cref="CursorVisibility"/></param>

+ 1 - 1
Terminal.Gui/ConsoleDrivers/FakeDriver/FakeDriver.cs

@@ -455,7 +455,7 @@ public class FakeDriver : ConsoleDriver
             }
         }
 
-        Clip = new Rect (0, 0, Cols, Rows);
+        Clip = new Rectangle (0, 0, Cols, Rows);
     }
 
     public override void UpdateCursor ()

+ 3 - 3
Terminal.Gui/ConsoleDrivers/NetDriver.cs

@@ -1205,11 +1205,11 @@ internal class NetDriver : ConsoleDriver
             }
             catch (IOException)
             {
-                Clip = new Rect (0, 0, Cols, Rows);
+                Clip = new Rectangle (0, 0, Cols, Rows);
             }
             catch (ArgumentOutOfRangeException)
             {
-                Clip = new Rect (0, 0, Cols, Rows);
+                Clip = new Rectangle (0, 0, Cols, Rows);
             }
         }
         else
@@ -1217,7 +1217,7 @@ internal class NetDriver : ConsoleDriver
             Console.Out.Write (EscSeqUtils.CSI_SetTerminalWindowSize (Rows, Cols));
         }
 
-        Clip = new Rect (0, 0, Cols, Rows);
+        Clip = new Rectangle (0, 0, Cols, Rows);
     }
 
     #endregion

+ 2 - 2
Terminal.Gui/ConsoleDrivers/WindowsDriver.cs

@@ -1330,7 +1330,7 @@ internal class WindowsDriver : ConsoleDriver
         CurrentAttribute = new Attribute (Color.White, Color.Black);
 
         _outputBuffer = new WindowsConsole.ExtendedCharInfo [Rows * Cols];
-        Clip = new Rect (0, 0, Cols, Rows);
+        Clip = new Rectangle (0, 0, Cols, Rows);
 
         _damageRegion = new WindowsConsole.SmallRect
         {
@@ -1725,7 +1725,7 @@ internal class WindowsDriver : ConsoleDriver
     private void ResizeScreen ()
     {
         _outputBuffer = new WindowsConsole.ExtendedCharInfo [Rows * Cols];
-        Clip = new Rect (0, 0, Cols, Rows);
+        Clip = new Rectangle (0, 0, Cols, Rows);
 
         _damageRegion = new WindowsConsole.SmallRect
         {

+ 9 - 9
Terminal.Gui/Drawing/LineCanvas.cs

@@ -48,7 +48,7 @@ public class LineCanvas : IDisposable
         // TODO: Add other resolvers
     };
 
-    private Rect _cachedBounds;
+    private Rectangle _cachedBounds;
 
     /// <summary>Creates a new instance.</summary>
     public LineCanvas ()
@@ -67,7 +67,7 @@ public class LineCanvas : IDisposable
     ///     Gets the rectangle that describes the bounds of the canvas. Location is the coordinates of the line that is
     ///     furthest left/top and Size is defined by the line that extends the furthest right/bottom.
     /// </summary>
-    public Rect Bounds
+    public Rectangle Bounds
     {
         get
         {
@@ -78,11 +78,11 @@ public class LineCanvas : IDisposable
                     return _cachedBounds;
                 }
 
-                Rect bounds = _lines [0].Bounds;
+                Rectangle bounds = _lines [0].Bounds;
 
                 for (var i = 1; i < _lines.Count; i++)
                 {
-                    bounds = Rect.Union (bounds, _lines [i].Bounds);
+                    bounds = Rectangle.Union (bounds, _lines [i].Bounds);
                 }
 
                 if (bounds is {Width: 0} or {Height: 0})
@@ -134,7 +134,7 @@ public class LineCanvas : IDisposable
         Attribute? attribute = default
     )
     {
-        _cachedBounds = Rect.Empty;
+        _cachedBounds = Rectangle.Empty;
         _lines.Add (new StraightLine (start, length, orientation, style, attribute));
     }
 
@@ -142,14 +142,14 @@ public class LineCanvas : IDisposable
     /// <param name="line"></param>
     public void AddLine (StraightLine line)
     {
-        _cachedBounds = Rect.Empty;
+        _cachedBounds = Rectangle.Empty;
         _lines.Add (line);
     }
 
     /// <summary>Clears all lines from the LineCanvas.</summary>
     public void Clear ()
     {
-        _cachedBounds = Rect.Empty;
+        _cachedBounds = Rectangle.Empty;
         _lines.Clear ();
     }
 
@@ -157,7 +157,7 @@ public class LineCanvas : IDisposable
     ///     Clears any cached states from the canvas Call this method if you make changes to lines that have already been
     ///     added.
     /// </summary>
-    public void ClearCache () { _cachedBounds = Rect.Empty; }
+    public void ClearCache () { _cachedBounds = Rectangle.Empty; }
 
     /// <summary>
     ///     Evaluates the lines that have been added to the canvas and returns a map containing the glyphs and their
@@ -200,7 +200,7 @@ public class LineCanvas : IDisposable
     /// </summary>
     /// <param name="inArea">A rectangle to constrain the search by.</param>
     /// <returns>A map of the points within the canvas that intersect with <paramref name="inArea"/>.</returns>
-    public Dictionary<Point, Rune> GetMap (Rect inArea)
+    public Dictionary<Point, Rune> GetMap (Rectangle inArea)
     {
         Dictionary<Point, Rune> map = new ();
 

+ 2 - 2
Terminal.Gui/Drawing/StraightLine.cs

@@ -45,7 +45,7 @@ public class StraightLine
     ///     Gets the rectangle that describes the bounds of the canvas. Location is the coordinates of the line that is
     ///     furthest left/top and Size is defined by the line that extends the furthest right/bottom.
     /// </summary>
-    internal Rect Bounds
+    internal Rectangle Bounds
     {
         get
         {
@@ -59,7 +59,7 @@ public class StraightLine
             int width = Orientation == Orientation.Horizontal ? size : 1;
             int height = Orientation == Orientation.Vertical ? size : 1;
 
-            return new Rect (x, y, width, height);
+            return new Rectangle (x, y, width, height);
         }
     }
 

+ 12 - 12
Terminal.Gui/Drawing/Thickness.cs

@@ -9,10 +9,10 @@ namespace Terminal.Gui;
 /// </summary>
 /// <remarks>
 ///     <para>
-///         Use the helper API (<see cref="GetInside(Rect)"/> to get the rectangle describing the insides of the frame,
+///         Use the helper API (<see cref="GetInside(Rectangle)"/> to get the rectangle describing the insides of the frame,
 ///         with the thickness widths subtracted.
 ///     </para>
-///     <para>Use the helper API (<see cref="Draw(Rect, string)"/> to draw the frame with the specified thickness.</para>
+///     <para>Use the helper API (<see cref="Draw(Rectangle, string)"/> to draw the frame with the specified thickness.</para>
 /// </remarks>
 public class Thickness : IEquatable<Thickness>
 {
@@ -87,15 +87,15 @@ public class Thickness : IEquatable<Thickness>
 
     /// <summary>
     ///     Gets whether the specified coordinates lie within the thickness (inside the bounding rectangle but outside of
-    ///     the rectangle described by <see cref="GetInside(Rect)"/>.
+    ///     the rectangle described by <see cref="GetInside(Rectangle)"/>.
     /// </summary>
     /// <param name="outside">Describes the location and size of the rectangle that contains the thickness.</param>
     /// <param name="x">The x coord to check.</param>
     /// <param name="y">The y coord to check.</param>
     /// <returns><see langword="true"/> if the specified coordinate is within the thickness; <see langword="false"/> otherwise.</returns>
-    public bool Contains (Rect outside, int x, int y)
+    public bool Contains (Rectangle outside, int x, int y)
     {
-        Rect inside = GetInside (outside);
+        Rectangle inside = GetInside (outside);
 
         return outside.Contains (x, y) && !inside.Contains (x, y);
     }
@@ -111,11 +111,11 @@ public class Thickness : IEquatable<Thickness>
     /// <param name="rect">The location and size of the rectangle that bounds the thickness rectangle, in screen coordinates.</param>
     /// <param name="label">The diagnostics label to draw on the bottom of the <see cref="Bottom"/>.</param>
     /// <returns>The inner rectangle remaining to be drawn.</returns>
-    public Rect Draw (Rect rect, string label = null)
+    public Rectangle Draw (Rectangle rect, string label = null)
     {
         if (rect.Size.Width < 1 || rect.Size.Height < 1)
         {
-            return Rect.Empty;
+            return Rectangle.Empty;
         }
 
         var clearChar = (Rune)' ';
@@ -141,20 +141,20 @@ public class Thickness : IEquatable<Thickness>
         // Draw the Top side
         if (Top > 0)
         {
-            Application.Driver.FillRect (new Rect (rect.X, rect.Y, rect.Width, Math.Min (rect.Height, Top)), topChar);
+            Application.Driver.FillRect (new Rectangle (rect.X, rect.Y, rect.Width, Math.Min (rect.Height, Top)), topChar);
         }
 
         // Draw the Left side
         if (Left > 0)
         {
-            Application.Driver.FillRect (new Rect (rect.X, rect.Y, Math.Min (rect.Width, Left), rect.Height), leftChar);
+            Application.Driver.FillRect (new Rectangle (rect.X, rect.Y, Math.Min (rect.Width, Left), rect.Height), leftChar);
         }
 
         // Draw the Right side			
         if (Right > 0)
         {
             Application.Driver.FillRect (
-                                         new Rect (
+                                         new Rectangle (
                                                    Math.Max (0, rect.X + rect.Width - Right),
                                                    rect.Y,
                                                    Math.Min (rect.Width, Right),
@@ -168,7 +168,7 @@ public class Thickness : IEquatable<Thickness>
         if (Bottom > 0)
         {
             Application.Driver.FillRect (
-                                         new Rect (
+                                         new Rectangle (
                                                    rect.X,
                                                    rect.Y + Math.Max (0, rect.Height - Bottom),
                                                    rect.Width,
@@ -266,7 +266,7 @@ public class Thickness : IEquatable<Thickness>
     /// </remarks>
     /// <param name="rect">The source rectangle</param>
     /// <returns></returns>
-    public Rect GetInside (Rect rect)
+    public Rectangle GetInside (Rectangle rect)
     {
         int x = rect.X + Left;
         int y = rect.Y + Top;

+ 1 - 1
Terminal.Gui/Text/Autocomplete/PopupAutocomplete.PopUp.cs

@@ -16,7 +16,7 @@ public abstract partial class PopupAutocomplete
 
         public override bool MouseEvent (MouseEvent mouseEvent) { return _autoComplete.MouseEvent (mouseEvent); }
 
-        public override void OnDrawContent (Rect contentArea)
+        public override void OnDrawContent (Rectangle contentArea)
         {
             if (!_autoComplete.LastPopupPos.HasValue)
             {

+ 3 - 3
Terminal.Gui/Text/Autocomplete/PopupAutocomplete.cs

@@ -357,14 +357,14 @@ public abstract partial class PopupAutocomplete : AutocompleteBase
 
         if (PopupInsideContainer)
         {
-            popup.Frame = new Rect (
+            popup.Frame = new Rectangle (
                                     new Point (HostControl.Frame.X + renderAt.X, HostControl.Frame.Y + renderAt.Y),
                                     new Size (width, height)
                                    );
         }
         else
         {
-            popup.Frame = new Rect (
+            popup.Frame = new Rectangle (
                                     new Point (HostControl.Frame.X + renderAt.X, renderAt.Y),
                                     new Size (width, height)
                                    );
@@ -520,7 +520,7 @@ public abstract partial class PopupAutocomplete : AutocompleteBase
     {
         if (Visible && popup is null)
         {
-            popup = new Popup (this) { Frame = Rect.Empty };
+            popup = new Popup (this) { Frame = Rectangle.Empty };
             top?.Add (popup);
         }
 

+ 9 - 9
Terminal.Gui/Text/TextFormatter.cs

@@ -1,4 +1,4 @@
-namespace Terminal.Gui;
+namespace Terminal.Gui;
 
 /// <summary>Text alignment enumeration, controls how text is displayed.</summary>
 public enum TextAlignment
@@ -307,10 +307,10 @@ public class TextFormatter
     /// <param name="driver">The console driver currently used by the application.</param>
     /// <exception cref="ArgumentOutOfRangeException"></exception>
     public void Draw (
-        Rect bounds,
+        Rectangle bounds,
         Attribute normalColor,
         Attribute hotColor,
-        Rect containerBounds = default,
+        Rectangle containerBounds = default,
         ConsoleDriver driver = null
     )
     {
@@ -338,13 +338,13 @@ public class TextFormatter
         }
 
         bool isVertical = IsVerticalDirection (Direction);
-        Rect maxBounds = bounds;
+        Rectangle maxBounds = bounds;
 
         if (driver is { })
         {
-            maxBounds = containerBounds == default (Rect)
+            maxBounds = containerBounds == default (Rectangle)
                             ? bounds
-                            : new Rect (
+                            : new Rectangle (
                                         Math.Max (containerBounds.X, bounds.X),
                                         Math.Max (containerBounds.Y, bounds.Y),
                                         Math.Max (
@@ -1851,7 +1851,7 @@ public class TextFormatter
     /// <param name="direction">The text direction.</param>
     /// <param name="tabWidth">The number of columns used for a tab.</param>
     /// <returns></returns>
-    public static Rect CalcRect (
+    public static Rectangle CalcRect (
         int x,
         int y,
         string text,
@@ -1861,7 +1861,7 @@ public class TextFormatter
     {
         if (string.IsNullOrEmpty (text))
         {
-            return new Rect (new Point (x, y), Size.Empty);
+            return new Rectangle (new Point (x, y), Size.Empty);
         }
 
         int w, h;
@@ -1978,7 +1978,7 @@ public class TextFormatter
             h = vh;
         }
 
-        return new Rect (x, y, w, h);
+        return new Rectangle (x, y, w, h);
     }
 
     /// <summary>Finds the HotKey and its location in text.</summary>

+ 24 - 21
Terminal.Gui/Types/Rect.cs → Terminal.Gui/Types/Rectangle.cs

@@ -11,7 +11,7 @@
 namespace Terminal.Gui;
 
 /// <summary>Stores a set of four integers that represent the location and size of a rectangle</summary>
-public struct Rect
+public struct Rectangle
 {
     private int width;
     private int height;
@@ -54,18 +54,18 @@ public struct Rect
 
     /// <summary>Empty Shared Field</summary>
     /// <remarks>An uninitialized Rectangle Structure.</remarks>
-    public static readonly Rect Empty;
+    public static readonly Rectangle Empty;
 
     /// <summary>FromLTRB Shared Method</summary>
     /// <remarks>Produces a Rectangle structure from left, top, right and bottom coordinates.</remarks>
-    public static Rect FromLTRB (
+    public static Rectangle FromLTRB (
         int left,
         int top,
         int right,
         int bottom
     )
     {
-        return new Rect (
+        return new Rectangle (
                          left,
                          top,
                          right - left,
@@ -78,9 +78,9 @@ public struct Rect
     ///     Produces a new Rect by inflating an existing Rect by the specified coordinate values. The rectangle is
     ///     enlarged in both directions along an axis.
     /// </remarks>
-    public static Rect Inflate (Rect rect, int x, int y)
+    public static Rectangle Inflate (Rectangle rect, int x, int y)
     {
-        var r = new Rect (rect.Location, rect.Size);
+        var r = new Rectangle (rect.Location, rect.Size);
         r.Inflate (x, y);
 
         return r;
@@ -110,7 +110,7 @@ public struct Rect
 
     /// <summary>Intersect Shared Method</summary>
     /// <remarks>Produces a new Rectangle by intersecting 2 existing Rectangles. Returns Empty if there is no intersection.</remarks>
-    public static Rect Intersect (Rect a, Rect b)
+    public static Rectangle Intersect (Rectangle a, Rectangle b)
     {
         // MS.NET returns a non-empty rectangle if the two rectangles
         // touch each other
@@ -129,11 +129,11 @@ public struct Rect
 
     /// <summary>Intersect Method</summary>
     /// <remarks>Replaces the Rectangle with the intersection of itself and another Rectangle.</remarks>
-    public void Intersect (Rect rect) { this = Intersect (this, rect); }
+    public void Intersect (Rectangle rect) { this = Intersect (this, rect); }
 
     /// <summary>Produces the uninion of two rectangles.</summary>
     /// <remarks>Produces a new Rectangle from the union of 2 existing Rectangles.</remarks>
-    public static Rect Union (Rect a, Rect b)
+    public static Rectangle Union (Rectangle a, Rectangle b)
     {
         //int x1 = Math.Min (a.X, b.X);
         //int x2 = Math.Max (a.X + a.Width, b.X + b.Width);
@@ -146,7 +146,7 @@ public struct Rect
         int y1 = Math.Min (a.Y, b.Y);
         int y2 = Math.Max (a.Y + Math.Abs (a.Height), b.Y + Math.Abs (b.Height));
 
-        return new Rect (x1, y1, x2 - x1, y2 - y1);
+        return new Rectangle (x1, y1, x2 - x1, y2 - y1);
     }
 
     /// <summary>Equality Operator</summary>
@@ -154,14 +154,14 @@ public struct Rect
     ///     Compares two Rectangle objects. The return value is based on the equivalence of the Location and Size
     ///     properties of the two Rectangles.
     /// </remarks>
-    public static bool operator == (Rect left, Rect right) { return left.Location == right.Location && left.Size == right.Size; }
+    public static bool operator == (Rectangle left, Rectangle right) { return left.Location == right.Location && left.Size == right.Size; }
 
     /// <summary>Inequality Operator</summary>
     /// <remarks>
     ///     Compares two Rectangle objects. The return value is based on the equivalence of the Location and Size
     ///     properties of the two Rectangles.
     /// </remarks>
-    public static bool operator != (Rect left, Rect right) { return left.Location != right.Location || left.Size != right.Size; }
+    public static bool operator != (Rectangle left, Rectangle right) { return left.Location != right.Location || left.Size != right.Size; }
 
     // -----------------------
     // Public Constructors
@@ -169,7 +169,7 @@ public struct Rect
 
     /// <summary>Rectangle Constructor</summary>
     /// <remarks>Creates a Rectangle from Point and Size values.</remarks>
-    public Rect (Point location, Size size)
+    public Rectangle (Point location, Size size)
     {
         X = location.X;
         Y = location.Y;
@@ -181,7 +181,7 @@ public struct Rect
 
     /// <summary>Rectangle Constructor</summary>
     /// <remarks>Creates a Rectangle from a specified x,y location and width and height values.</remarks>
-    public Rect (int x, int y, int width, int height)
+    public Rectangle (int x, int y, int width, int height)
     {
         X = x;
         Y = y;
@@ -245,29 +245,32 @@ public struct Rect
 
     /// <summary>Contains Method</summary>
     /// <remarks>Checks if a Rectangle lies entirely within this Rectangle.</remarks>
-    public bool Contains (Rect rect) { return rect == Intersect (this, rect); }
+    public bool Contains (Rectangle rect) { return rect == Intersect (this, rect); }
 
     /// <summary>Equals Method</summary>
     /// <remarks>Checks equivalence of this Rectangle and another object.</remarks>
     public override bool Equals (object obj)
     {
-        if (!(obj is Rect))
+        if (!(obj is Rectangle))
         {
             return false;
         }
 
-        return this == (Rect)obj;
+        return this == (Rectangle)obj;
     }
 
     /// <summary>GetHashCode Method</summary>
     /// <remarks>Calculates a hashing value.</remarks>
-    public override int GetHashCode () { return (Height + Width) ^ (X + Y); }
+    public override int GetHashCode () { return X ^
+                                                ((Y << 13) | (Y >>> 19)) ^
+                                                ((Width << 26) | (Width >>>  6)) ^
+                                                ((Height <<  7) | (Height >>> 25)); }
 
     /// <summary>IntersectsWith Method</summary>
     /// <remarks>Checks if a Rectangle intersects with this one.</remarks>
-    public bool IntersectsWith (Rect rect) { return !(Left >= rect.Right || Right <= rect.Left || Top >= rect.Bottom || Bottom <= rect.Top); }
+    public bool IntersectsWith (Rectangle rect) { return !(Left >= rect.Right || Right <= rect.Left || Top >= rect.Bottom || Bottom <= rect.Top); }
 
-    private bool IntersectsWithInclusive (Rect r) { return !(Left > r.Right || Right < r.Left || Top > r.Bottom || Bottom < r.Top); }
+    private bool IntersectsWithInclusive (Rectangle r) { return !(Left > r.Right || Right < r.Left || Top > r.Bottom || Bottom < r.Top); }
 
     /// <summary>Offset Method</summary>
     /// <remarks>Moves the Rectangle a specified distance.</remarks>
@@ -287,5 +290,5 @@ public struct Rect
 
     /// <summary>ToString Method</summary>
     /// <remarks>Formats the Rectangle as a string in (x,y,w,h) notation.</remarks>
-    public override string ToString () { return $"({X},{Y},{Width},{Height})"; }
+    public override string ToString () { return $"{{X={X},Y={Y},Width={Width},Height={Height}}}"; }
 }

+ 8 - 8
Terminal.Gui/Types/RectangleF.cs

@@ -143,19 +143,19 @@ public struct RectangleF : IEquatable<RectangleF>
 
     /// <summary>
     ///     Determines if the specified point is contained within the rectangular region defined by this
-    ///     <see cref='Terminal.Gui.Rect'/> .
+    ///     <see cref='Rectangle'/> .
     /// </summary>
     public bool Contains (float x, float y) { return X <= x && x < X + Width && Y <= y && y < Y + Height; }
 
     /// <summary>
     ///     Determines if the specified point is contained within the rectangular region defined by this
-    ///     <see cref='Terminal.Gui.Rect'/> .
+    ///     <see cref='Rectangle'/> .
     /// </summary>
     public bool Contains (PointF pt) { return Contains (pt.X, pt.Y); }
 
     /// <summary>
     ///     Determines if the rectangular region represented by <paramref name="rect"/> is entirely contained within the
-    ///     rectangular region represented by this <see cref='Terminal.Gui.Rect'/> .
+    ///     rectangular region represented by this <see cref='Rectangle'/> .
     /// </summary>
     public bool Contains (RectangleF rect)
     {
@@ -168,7 +168,7 @@ public struct RectangleF : IEquatable<RectangleF>
     /// <summary>Gets the hash code for this <see cref='Terminal.Gui.RectangleF'/>.</summary>
     public override int GetHashCode () { return (Height.GetHashCode () + Width.GetHashCode ()) ^ (X.GetHashCode () + Y.GetHashCode ()); }
 
-    /// <summary>Inflates this <see cref='Terminal.Gui.Rect'/> by the specified amount.</summary>
+    /// <summary>Inflates this <see cref='Rectangle'/> by the specified amount.</summary>
     public void Inflate (float x, float y)
     {
         X -= x;
@@ -177,10 +177,10 @@ public struct RectangleF : IEquatable<RectangleF>
         Height += 2 * y;
     }
 
-    /// <summary>Inflates this <see cref='Terminal.Gui.Rect'/> by the specified amount.</summary>
+    /// <summary>Inflates this <see cref='Rectangle'/> by the specified amount.</summary>
     public void Inflate (SizeF size) { Inflate (size.Width, size.Height); }
 
-    /// <summary>Creates a <see cref='Terminal.Gui.Rect'/> that is inflated by the specified amount.</summary>
+    /// <summary>Creates a <see cref='Rectangle'/> that is inflated by the specified amount.</summary>
     public static RectangleF Inflate (RectangleF rect, float x, float y)
     {
         RectangleF r = rect;
@@ -249,8 +249,8 @@ public struct RectangleF : IEquatable<RectangleF>
         Y += y;
     }
 
-    /// <summary>Converts the specified <see cref='Terminal.Gui.Rect'/> to a <see cref='Terminal.Gui.RectangleF'/>.</summary>
-    public static implicit operator RectangleF (Rect r) { return new RectangleF (r.X, r.Y, r.Width, r.Height); }
+    /// <summary>Converts the specified <see cref='Rectangle'/> to a <see cref='Terminal.Gui.RectangleF'/>.</summary>
+    public static implicit operator RectangleF (Rectangle r) { return new RectangleF (r.X, r.Y, r.Width, r.Height); }
 
     /// <summary>
     ///     Converts the <see cref='Terminal.Gui.RectangleF.Location'/> and <see cref='Terminal.Gui.RectangleF.Size'/> of

+ 8 - 8
Terminal.Gui/View/Adornment/Adornment.cs

@@ -31,9 +31,9 @@ public class Adornment : View
     public Adornment (View parent) { Parent = parent; }
 
     /// <summary>Gets the rectangle that describes the inner area of the Adornment. The Location is always (0,0).</summary>
-    public override Rect Bounds
+    public override Rectangle Bounds
     {
-        get => Thickness?.GetInside (new Rect (Point.Empty, Frame.Size)) ?? new Rect (Point.Empty, Frame.Size);
+        get => Thickness?.GetInside (new Rectangle (Point.Empty, Frame.Size)) ?? new Rectangle (Point.Empty, Frame.Size);
         set => throw new InvalidOperationException ("It makes no sense to set Bounds of a Thickness.");
     }
 
@@ -87,7 +87,7 @@ public class Adornment : View
         // Adornments are *Children* of a View, not SubViews. Thus View.BoundsToScreen will not work.
         // To get the screen-relative coordinates of a Adornment, we need to know who
         // the Parent is
-        Rect parentFrame = Parent?.Frame ?? Frame;
+        Rectangle parentFrame = Parent?.Frame ?? Frame;
         rrow = row + parentFrame.Y;
         rcol = col + parentFrame.X;
 
@@ -97,12 +97,12 @@ public class Adornment : View
     }
 
     /// <inheritdoc/>
-    public override Rect FrameToScreen ()
+    public override Rectangle FrameToScreen ()
     {
         // Adornments are *Children* of a View, not SubViews. Thus View.FrameToScreen will not work.
         // To get the screen-relative coordinates of a Adornment, we need to know who
         // the Parent is
-        Rect ret = Parent?.Frame ?? Frame;
+        Rectangle ret = Parent?.Frame ?? Frame;
         ret.Size = Frame.Size;
 
         ret.Location = Parent?.FrameToScreen ().Location ?? ret.Location;
@@ -117,14 +117,14 @@ public class Adornment : View
     public override bool OnDrawAdornments () { return false; }
 
     /// <summary>Redraws the Adornments that comprise the <see cref="Adornment"/>.</summary>
-    public override void OnDrawContent (Rect contentArea)
+    public override void OnDrawContent (Rectangle contentArea)
     {
         if (Thickness == Thickness.Empty)
         {
             return;
         }
 
-        Rect screenBounds = BoundsToScreen (Frame);
+        Rectangle screenBounds = BoundsToScreen (Frame);
 
         Attribute normalAttr = GetNormalColor ();
 
@@ -141,7 +141,7 @@ public class Adornment : View
             }
         }
 
-        TextFormatter?.Draw (screenBounds, normalAttr, normalAttr, Rect.Empty);
+        TextFormatter?.Draw (screenBounds, normalAttr, normalAttr, Rectangle.Empty);
 
         //base.OnDrawContent (contentArea);
     }

+ 9 - 9
Terminal.Gui/View/Adornment/Border.cs

@@ -1,4 +1,4 @@
-namespace Terminal.Gui;
+namespace Terminal.Gui;
 
 /// <summary>The Border for a <see cref="View"/>.</summary>
 /// <remarks>
@@ -103,10 +103,10 @@ public class Border : Adornment
     /// <param name="region">View-relative region for the frame to be drawn.</param>
     /// <param name="clear">If set to <see langword="true"/> it clear the region.</param>
     [Obsolete ("This method is obsolete in v2. Use use LineCanvas or Frame instead.", false)]
-    public void DrawFrame (Rect region, bool clear)
+    public void DrawFrame (Rectangle region, bool clear)
     {
-        Rect savedClip = ClipToBounds ();
-        Rect screenBounds = BoundsToScreen (region);
+        Rectangle savedClip = ClipToBounds ();
+        Rectangle screenBounds = BoundsToScreen (region);
 
         if (clear)
         {
@@ -194,7 +194,7 @@ public class Border : Adornment
     }
     
     /// <inheritdoc/>
-    public override void OnDrawContent (Rect contentArea)
+    public override void OnDrawContent (Rectangle contentArea)
     {
         base.OnDrawContent (contentArea);
 
@@ -204,7 +204,7 @@ public class Border : Adornment
         }
 
         //Driver.SetAttribute (Colors.ColorSchemes ["Error"].Normal);
-        Rect screenBounds = BoundsToScreen (Frame);
+        Rectangle screenBounds = BoundsToScreen (Frame);
 
         //OnDrawSubviews (bounds); 
 
@@ -213,7 +213,7 @@ public class Border : Adornment
         // The border adornment (and title) are drawn at the outermost edge of border; 
         // For Border
         // ...thickness extends outward (border/title is always as far in as possible)
-        var borderBounds = new Rect (
+        var borderBounds = new Rectangle (
                                      screenBounds.X + Math.Max (0, Thickness.Left - 1),
                                      screenBounds.Y + Math.Max (0, Thickness.Top - 1),
                                      Math.Max (
@@ -285,7 +285,7 @@ public class Border : Adornment
 
         if (canDrawBorder && Thickness.Top > 0 && maxTitleWidth > 0 && !string.IsNullOrEmpty (Parent?.Title))
         {
-            Parent.TitleTextFormatter.Draw (new Rect (borderBounds.X + 2, titleY, maxTitleWidth, 1),
+            Parent.TitleTextFormatter.Draw (new (borderBounds.X + 2, titleY, maxTitleWidth, 1),
                                             Parent.HasFocus ? Parent.GetFocusColor () : Parent.GetNormalColor (),
                                             Parent.HasFocus ? Parent.GetFocusColor () : Parent.GetHotNormalColor ());
         }
@@ -464,7 +464,7 @@ public class Border : Adornment
                 // Redraw title 
                 if (drawTop && maxTitleWidth > 0 && !string.IsNullOrEmpty (Parent?.Title))
                 {
-                    Parent.TitleTextFormatter.Draw (new Rect (borderBounds.X + 2, titleY, maxTitleWidth, 1),
+                    Parent.TitleTextFormatter.Draw (new (borderBounds.X + 2, titleY, maxTitleWidth, 1),
                                                     Parent.HasFocus ? Parent.GetFocusColor () : Parent.GetNormalColor (),
                                                     Parent.HasFocus ? Parent.GetFocusColor () : Parent.GetNormalColor ());
                 }

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

@@ -37,7 +37,7 @@ public enum LayoutStyle
 public partial class View
 {
     private bool _autoSize;
-    private Rect _frame;
+    private Rectangle _frame;
     private Dim _height = Dim.Sized (0);
     private Dim _width = Dim.Sized (0);
     private Pos _x = Pos.At (0);
@@ -155,7 +155,7 @@ public partial class View
     ///     </para>
     ///     <para>
     ///         Altering the Bounds will eventually (when the view is next laid out) cause the
-    ///         <see cref="LayoutSubview(View, Rect)"/> and <see cref="OnDrawContent(Rect)"/> methods to be called.
+    ///         <see cref="LayoutSubview(View, Rectangle)"/> and <see cref="OnDrawContent(Rectangle)"/> methods to be called.
     ///     </para>
     ///     <para>
     ///         Because <see cref="Bounds"/> coordinates are relative to the upper-left corner of the <see cref="View"/>, the
@@ -163,7 +163,7 @@ public partial class View
     ///         obtain the size of the area of the view for tasks such as drawing the view's contents.
     ///     </para>
     /// </remarks>
-    public virtual Rect Bounds
+    public virtual Rectangle Bounds
     {
         get
         {
@@ -179,7 +179,7 @@ public partial class View
             // BUGBUG: I think there's a bug here. This should be && not ||
             if (Margin is null || Border is null || Padding is null)
             {
-                return new Rect (default (Point), Frame.Size);
+                return new Rectangle (default (Point), Frame.Size);
             }
 
             int width = Math.Max (
@@ -195,7 +195,7 @@ public partial class View
                                    Frame.Size.Height - Margin.Thickness.Vertical - Border.Thickness.Vertical - Padding.Thickness.Vertical
                                   );
 
-            return new Rect (Point.Empty, new Size (width, height));
+            return new Rectangle (Point.Empty, new Size (width, height));
         }
         set
         {
@@ -209,7 +209,7 @@ public partial class View
                                 );
             }
 #endif // DEBUG
-            Frame = new Rect (
+            Frame = new Rectangle (
                               Frame.Location,
                               new Size (
                                         value.Size.Width
@@ -239,16 +239,16 @@ public partial class View
     ///     <para>This causes <see cref="LayoutStyle"/> to be <see cref="LayoutStyle.Absolute"/>.</para>
     ///     <para>
     ///         Altering the Frame will eventually (when the view hierarchy is next laid out via  see
-    ///         cref="LayoutSubviews"/>) cause <see cref="LayoutSubview(View, Rect)"/> and <see cref="OnDrawContent(Rect)"/>
+    ///         cref="LayoutSubviews"/>) cause <see cref="LayoutSubview(View, Rectangle)"/> and <see cref="OnDrawContent(Rectangle)"/>
     ///         methods to be called.
     ///     </para>
     /// </remarks>
-    public Rect Frame
+    public Rectangle Frame
     {
         get => _frame;
         set
         {
-            _frame = new Rect (value.X, value.Y, Math.Max (value.Width, 0), Math.Max (value.Height, 0));
+            _frame = new Rectangle (value.X, value.Y, Math.Max (value.Width, 0), Math.Max (value.Height, 0));
 
             // If Frame gets set, by definition, the View is now LayoutStyle.Absolute, so
             // set all Pos/Dim to Absolute values.
@@ -273,12 +273,12 @@ public partial class View
     /// <remarks>
     ///     <para>
     ///         If set to a relative value (e.g. <see cref="Dim.Fill(int)"/>) the value is indeterminate until the view has
-    ///         been initialized ( <see cref="IsInitialized"/> is true) and <see cref="SetRelativeLayout(Rect)"/> has been
+    ///         been initialized ( <see cref="IsInitialized"/> is true) and <see cref="SetRelativeLayout(Rectangle)"/> has been
     ///         called.
     ///     </para>
     ///     <para>
     ///         Changing this property will eventually (when the view is next drawn) cause the
-    ///         <see cref="LayoutSubview(View, Rect)"/> and <see cref="OnDrawContent(Rect)"/> methods to be called.
+    ///         <see cref="LayoutSubview(View, Rectangle)"/> and <see cref="OnDrawContent(Rectangle)"/> methods to be called.
     ///     </para>
     ///     <para>
     ///         Changing this property will cause <see cref="Frame"/> to be updated. If the new value is not of type
@@ -398,12 +398,12 @@ public partial class View
     /// <remarks>
     ///     <para>
     ///         If set to a relative value (e.g. <see cref="Dim.Fill(int)"/>) the value is indeterminate until the view has
-    ///         been initialized ( <see cref="IsInitialized"/> is true) and <see cref="SetRelativeLayout(Rect)"/> has been
+    ///         been initialized ( <see cref="IsInitialized"/> is true) and <see cref="SetRelativeLayout(Rectangle)"/> has been
     ///         called.
     ///     </para>
     ///     <para>
     ///         Changing this property will eventually (when the view is next drawn) cause the
-    ///         <see cref="LayoutSubview(View, Rect)"/> and <see cref="OnDrawContent(Rect)"/> methods to be called.
+    ///         <see cref="LayoutSubview(View, Rectangle)"/> and <see cref="OnDrawContent(Rectangle)"/> methods to be called.
     ///     </para>
     ///     <para>
     ///         Changing this property will cause <see cref="Frame"/> to be updated. If the new value is not of type
@@ -439,11 +439,11 @@ public partial class View
     /// <remarks>
     ///     <para>
     ///         If set to a relative value (e.g. <see cref="Pos.Center"/>) the value is indeterminate until the view has been
-    ///         initialized ( <see cref="IsInitialized"/> is true) and <see cref="SetRelativeLayout(Rect)"/> has been called.
+    ///         initialized ( <see cref="IsInitialized"/> is true) and <see cref="SetRelativeLayout(Rectangle)"/> has been called.
     ///     </para>
     ///     <para>
     ///         Changing this property will eventually (when the view is next drawn) cause the
-    ///         <see cref="LayoutSubview(View, Rect)"/> and <see cref="OnDrawContent(Rect)"/> methods to be called.
+    ///         <see cref="LayoutSubview(View, Rectangle)"/> and <see cref="OnDrawContent(Rectangle)"/> methods to be called.
     ///     </para>
     ///     <para>
     ///         Changing this property will cause <see cref="Frame"/> to be updated. If the new value is not of type
@@ -466,11 +466,11 @@ public partial class View
     /// <remarks>
     ///     <para>
     ///         If set to a relative value (e.g. <see cref="Pos.Center"/>) the value is indeterminate until the view has been
-    ///         initialized ( <see cref="IsInitialized"/> is true) and <see cref="SetRelativeLayout(Rect)"/> has been called.
+    ///         initialized ( <see cref="IsInitialized"/> is true) and <see cref="SetRelativeLayout(Rectangle)"/> has been called.
     ///     </para>
     ///     <para>
     ///         Changing this property will eventually (when the view is next drawn) cause the
-    ///         <see cref="LayoutSubview(View, Rect)"/> and <see cref="OnDrawContent(Rect)"/> methods to be called.
+    ///         <see cref="LayoutSubview(View, Rectangle)"/> and <see cref="OnDrawContent(Rectangle)"/> methods to be called.
     ///     </para>
     ///     <para>
     ///         Changing this property will cause <see cref="Frame"/> to be updated. If the new value is not of type
@@ -498,11 +498,11 @@ public partial class View
     public event EventHandler Initialized;
 
     /// <summary>Converts a <see cref="Bounds"/>-relative region to a screen-relative region.</summary>
-    public Rect BoundsToScreen (Rect region)
+    public Rectangle BoundsToScreen (Rectangle region)
     {
         BoundsToScreen (region.X, region.Y, out int x, out int y, false);
 
-        return new Rect (x, y, region.Width, region.Height);
+        return new Rectangle (x, y, region.Width, region.Height);
     }
 
     /// <summary>
@@ -561,7 +561,7 @@ public partial class View
             return null;
         }
 
-        Rect startFrame = start.Frame;
+        Rectangle startFrame = start.Frame;
 
         if (start.InternalSubviews is { })
         {
@@ -600,9 +600,9 @@ public partial class View
 
     /// <summary>Gets the <see cref="Frame"/> with a screen-relative location.</summary>
     /// <returns>The location and size of the view in screen-relative coordinates.</returns>
-    public virtual Rect FrameToScreen ()
+    public virtual Rectangle FrameToScreen ()
     {
-        Rect ret = Frame;
+        Rectangle ret = Frame;
         View super = SuperView;
 
         while (super is { })
@@ -683,7 +683,7 @@ public partial class View
 
         LayoutAdornments ();
 
-        Rect oldBounds = Bounds;
+        Rectangle oldBounds = Bounds;
         OnLayoutStarted (new LayoutEventArgs { OldBounds = oldBounds });
 
         SetTextFormatterSize ();
@@ -696,7 +696,7 @@ public partial class View
 
         foreach (View v in ordered)
         {
-            LayoutSubview (v, new Rect (GetBoundsOffset (), Bounds.Size));
+            LayoutSubview (v, new Rectangle (GetBoundsOffset (), Bounds.Size));
         }
 
         // If the 'to' is rooted to 'from' and the layoutstyle is Computed it's a special-case.
@@ -853,7 +853,7 @@ public partial class View
 
         if (Margin.Frame.Size != Frame.Size)
         {
-            Margin._frame = new Rect (Point.Empty, Frame.Size);
+            Margin._frame = new Rectangle (Point.Empty, Frame.Size);
             Margin.X = 0;
             Margin.Y = 0;
             Margin.Width = Frame.Size.Width;
@@ -862,11 +862,11 @@ public partial class View
             Margin.SetNeedsDisplay ();
         }
 
-        Rect border = Margin.Thickness.GetInside (Margin.Frame);
+        Rectangle border = Margin.Thickness.GetInside (Margin.Frame);
 
         if (border != Border.Frame)
         {
-            Border._frame = new Rect (new Point (border.Location.X, border.Location.Y), border.Size);
+            Border._frame = new Rectangle (new Point (border.Location.X, border.Location.Y), border.Size);
             Border.X = border.Location.X;
             Border.Y = border.Location.Y;
             Border.Width = border.Size.Width;
@@ -875,11 +875,11 @@ public partial class View
             Border.SetNeedsDisplay ();
         }
 
-        Rect padding = Border.Thickness.GetInside (Border.Frame);
+        Rectangle padding = Border.Thickness.GetInside (Border.Frame);
 
         if (padding != Padding.Frame)
         {
-            Padding._frame = new Rect (new Point (padding.Location.X, padding.Location.Y), padding.Size);
+            Padding._frame = new Rectangle (new Point (padding.Location.X, padding.Location.Y), padding.Size);
             Padding.X = padding.Location.X;
             Padding.Y = padding.Location.Y;
             Padding.Width = padding.Size.Width;
@@ -908,7 +908,7 @@ public partial class View
     /// <remarks>
     ///     <para>
     ///         Determines the relative bounds of the <see cref="View"/> and its <see cref="Frame"/>s, and then calls
-    ///         <see cref="SetRelativeLayout(Rect)"/> to update the view.
+    ///         <see cref="SetRelativeLayout(Rectangle)"/> to update the view.
     ///     </para>
     /// </remarks>
     internal void OnResizeNeeded ()
@@ -917,9 +917,9 @@ public partial class View
         // TODO: Until then leave it `internal` and non-virtual
         // First try SuperView.Bounds, then Application.Top, then Driver.Bounds.
         // Finally, if none of those are valid, use int.MaxValue (for Unit tests).
-        Rect relativeBounds = SuperView is { IsInitialized: true } ? SuperView.Bounds :
+        Rectangle relativeBounds = SuperView is { IsInitialized: true } ? SuperView.Bounds :
                               Application.Top is { } && Application.Top.IsInitialized ? Application.Top.Bounds :
-                              Application.Driver?.Bounds ?? new Rect (0, 0, int.MaxValue, int.MaxValue);
+                              Application.Driver?.Bounds ?? new Rectangle (0, 0, int.MaxValue, int.MaxValue);
         SetRelativeLayout (relativeBounds);
 
         // TODO: Determine what, if any of the below is actually needed here.
@@ -968,7 +968,7 @@ public partial class View
     ///     The rectangle describing the SuperView's Bounds (nominally the same as
     ///     <c>this.SuperView.Bounds</c>).
     /// </param>
-    internal void SetRelativeLayout (Rect superviewBounds)
+    internal void SetRelativeLayout (Rectangle superviewBounds)
     {
         Debug.Assert (_x is { });
         Debug.Assert (_y is { });
@@ -996,7 +996,7 @@ public partial class View
         // This method is called recursively if pos is Pos.PosCombine
         (int newLocation, int newDimension) GetNewLocationAndDimension (
             bool width,
-            Rect superviewBounds,
+            Rectangle superviewBounds,
             Pos pos,
             Dim dim,
             int autosizeDimension
@@ -1137,7 +1137,7 @@ public partial class View
         // vertical/height
         (newY, newH) = GetNewLocationAndDimension (false, superviewBounds, _y, _height, autosize.Height);
 
-        var r = new Rect (newX, newY, newW, newH);
+        var r = new Rectangle (newX, newY, newW, newH);
 
         if (Frame != r)
         {
@@ -1175,7 +1175,7 @@ public partial class View
             {
                 // Set the frame. Do NOT use `Frame` as it overwrites X, Y, Width, and Height, making
                 // the view LayoutStyle.Absolute.
-                _frame = new Rect (Frame.Location, autosize);
+                _frame = new Rectangle (Frame.Location, autosize);
 
                 if (autosize.Width == 0)
                 {
@@ -1391,7 +1391,7 @@ public partial class View
         return canSetWidth;
     }
 
-    private void LayoutSubview (View v, Rect contentArea)
+    private void LayoutSubview (View v, Rectangle contentArea)
     {
         //if (v.LayoutStyle == LayoutStyle.Computed) {
         v.SetRelativeLayout (contentArea);
@@ -1430,7 +1430,7 @@ public partial class View
 
         if (boundsChanged)
         {
-            Bounds = new Rect (Bounds.X, Bounds.Y, canSizeW ? rW : Bounds.Width, canSizeH ? rH : Bounds.Height);
+            Bounds = new Rectangle (Bounds.X, Bounds.Y, canSizeW ? rW : Bounds.Width, canSizeH ? rH : Bounds.Height);
         }
 
         return boundsChanged;

+ 1 - 1
Terminal.Gui/View/View.cs

@@ -73,7 +73,7 @@ namespace Terminal.Gui;
 ///         a View can be accessed with the <see cref="SuperView"/> property.
 ///     </para>
 ///     <para>
-///         To flag a region of the View's <see cref="Bounds"/> to be redrawn call <see cref="SetNeedsDisplay(Rect)"/>.
+///         To flag a region of the View's <see cref="Bounds"/> to be redrawn call <see cref="SetNeedsDisplay(Rectangle)"/>.
 ///         To flag the entire view for redraw call <see cref="SetNeedsDisplay()"/>.
 ///     </para>
 ///     <para>

+ 21 - 21
Terminal.Gui/View/ViewDrawing.cs

@@ -3,7 +3,7 @@
 public partial class View
 {
     // The view-relative region that needs to be redrawn. Marked internal for unit tests.
-    internal Rect _needsDisplayRect = Rect.Empty;
+    internal Rectangle _needsDisplayRect = Rectangle.Empty;
     private ColorScheme _colorScheme;
 
     /// <summary>The color scheme for this view, if it is not defined, it returns the <see cref="SuperView"/>'s color scheme.</summary>
@@ -35,7 +35,7 @@ public partial class View
     /// <summary>Gets or sets whether the view needs to be redrawn.</summary>
     public bool NeedsDisplay
     {
-        get => _needsDisplayRect != Rect.Empty;
+        get => _needsDisplayRect != Rectangle.Empty;
         set
         {
             if (value)
@@ -98,7 +98,7 @@ public partial class View
     /// <summary>Clears the specified screen-relative rectangle with the normal background.</summary>
     /// <remarks></remarks>
     /// <param name="regionScreen">The screen-relative rectangle to clear.</param>
-    public void Clear (Rect regionScreen)
+    public void Clear (Rectangle regionScreen)
     {
         if (Driver is null)
         {
@@ -118,18 +118,18 @@ public partial class View
     /// <remarks>
     ///     <para>
     ///         If <see cref="ConsoleDriver.Clip"/> and <see cref="Bounds"/> do not intersect, the clip region will be set to
-    ///         <see cref="Rect.Empty"/>.
+    ///         <see cref="Rectangle.Empty"/>.
     ///     </para>
     /// </remarks>
-    public Rect ClipToBounds ()
+    public Rectangle ClipToBounds ()
     {
         if (Driver is null)
         {
-            return Rect.Empty;
+            return Rectangle.Empty;
         }
 
-        Rect previous = Driver.Clip;
-        Driver.Clip = Rect.Intersect (previous, BoundsToScreen (Bounds));
+        Rectangle previous = Driver.Clip;
+        Driver.Clip = Rectangle.Intersect (previous, BoundsToScreen (Bounds));
 
         return previous;
     }
@@ -140,7 +140,7 @@ public partial class View
     /// </summary>
     /// <remarks>
     ///     <para>
-    ///         Always use <see cref="Bounds"/> (view-relative) when calling <see cref="OnDrawContent(Rect)"/>, NOT
+    ///         Always use <see cref="Bounds"/> (view-relative) when calling <see cref="OnDrawContent(Rectangle)"/>, NOT
     ///         <see cref="Frame"/> (superview-relative).
     ///     </para>
     ///     <para>
@@ -148,7 +148,7 @@ public partial class View
     ///         was set globally on the driver.
     ///     </para>
     ///     <para>
-    ///         Overrides of <see cref="OnDrawContent(Rect)"/> must ensure they do not set <c>Driver.Clip</c> to a clip
+    ///         Overrides of <see cref="OnDrawContent(Rectangle)"/> must ensure they do not set <c>Driver.Clip</c> to a clip
     ///         region larger than the <ref name="Bounds"/> property, as this will cause the driver to clip the entire region.
     ///     </para>
     /// </remarks>
@@ -161,7 +161,7 @@ public partial class View
 
         OnDrawAdornments ();
 
-        Rect prevClip = ClipToBounds ();
+        Rectangle prevClip = ClipToBounds ();
 
         if (ColorScheme is { })
         {
@@ -367,7 +367,7 @@ public partial class View
     ///     <see cref="View"/>
     /// </param>
     /// <remarks>This method will be called before any subviews added with <see cref="Add(View)"/> have been drawn.</remarks>
-    public virtual void OnDrawContent (Rect contentArea)
+    public virtual void OnDrawContent (Rectangle contentArea)
     {
         if (NeedsDisplay)
         {
@@ -389,7 +389,7 @@ public partial class View
                                  BoundsToScreen (contentArea),
                                  HasFocus ? GetFocusColor () : GetNormalColor (),
                                  HasFocus ? ColorScheme.HotFocus : GetHotNormalColor (),
-                                 Rect.Empty
+                                 Rectangle.Empty
                                 );
             SetSubViewNeedsDisplay ();
         }
@@ -434,7 +434,7 @@ public partial class View
     ///     This method will be called after any subviews removed with <see cref="Remove(View)"/> have been completed
     ///     drawing.
     /// </remarks>
-    public virtual void OnDrawContentComplete (Rect contentArea) { DrawContentComplete?.Invoke (this, new DrawEventArgs (contentArea)); }
+    public virtual void OnDrawContentComplete (Rectangle contentArea) { DrawContentComplete?.Invoke (this, new DrawEventArgs (contentArea)); }
 
     // TODO: Make this cancelable
     /// <summary>
@@ -451,7 +451,7 @@ public partial class View
         }
 
         // If we have a SuperView, it'll render our frames.
-        if (!SuperViewRendersLineCanvas && LineCanvas.Bounds != Rect.Empty)
+        if (!SuperViewRendersLineCanvas && LineCanvas.Bounds != Rectangle.Empty)
         {
             foreach (KeyValuePair<Point, Cell> p in LineCanvas.GetCellMap ())
             {
@@ -510,7 +510,7 @@ public partial class View
     ///     redrawn will be the <paramref name="region"/>.
     /// </remarks>
     /// <param name="region">The Bounds-relative region that needs to be redrawn.</param>
-    public void SetNeedsDisplay (Rect region)
+    public void SetNeedsDisplay (Rectangle region)
     {
         if (!IsInitialized)
         {
@@ -529,7 +529,7 @@ public partial class View
             int y = Math.Min (_needsDisplayRect.Y, region.Y);
             int w = Math.Max (_needsDisplayRect.Width, region.Width);
             int h = Math.Max (_needsDisplayRect.Height, region.Height);
-            _needsDisplayRect = new Rect (x, y, w, h);
+            _needsDisplayRect = new Rectangle (x, y, w, h);
         }
 
         _superView?.SetSubViewNeedsDisplay ();
@@ -553,7 +553,7 @@ public partial class View
         {
             if (subview.Frame.IntersectsWith (region))
             {
-                Rect subviewRegion = Rect.Intersect (subview.Frame, region);
+                Rectangle subviewRegion = Rectangle.Intersect (subview.Frame, region);
                 subviewRegion.X -= subview.Frame.X;
                 subviewRegion.Y -= subview.Frame.Y;
                 subview.SetNeedsDisplay (subviewRegion);
@@ -575,12 +575,12 @@ public partial class View
     /// <summary>Clears <see cref="NeedsDisplay"/> and <see cref="SubViewNeedsDisplay"/>.</summary>
     protected void ClearNeedsDisplay ()
     {
-        _needsDisplayRect = Rect.Empty;
+        _needsDisplayRect = Rectangle.Empty;
         SubViewNeedsDisplay = false;
     }
 
     // Clips a rectangle in screen coordinates to the dimensions currently available on the screen
-    internal Rect ScreenClip (Rect regionScreen)
+    internal Rectangle ScreenClip (Rectangle regionScreen)
     {
         int x = regionScreen.X < 0 ? 0 : regionScreen.X;
         int y = regionScreen.Y < 0 ? 0 : regionScreen.Y;
@@ -593,6 +593,6 @@ public partial class View
                     ? Driver.Rows - regionScreen.Y
                     : regionScreen.Height;
 
-        return new Rect (x, y, w, h);
+        return new Rectangle (x, y, w, h);
     }
 }

+ 3 - 3
Terminal.Gui/View/ViewEventArgs.cs

@@ -19,7 +19,7 @@ public class ViewEventArgs : EventArgs
 public class LayoutEventArgs : EventArgs
 {
     /// <summary>The view-relative bounds of the <see cref="View"/> before it was laid out.</summary>
-    public Rect OldBounds { get; set; }
+    public Rectangle OldBounds { get; set; }
 }
 
 /// <summary>Event args for draw events</summary>
@@ -30,13 +30,13 @@ public class DrawEventArgs : EventArgs
     ///     Gets the view-relative rectangle describing the currently visible viewport into the
     ///     <see cref="View"/>.
     /// </param>
-    public DrawEventArgs (Rect rect) { Rect = rect; }
+    public DrawEventArgs (Rectangle rect) { Rectangle = rect; }
 
     /// <summary>If set to true, the draw operation will be canceled, if applicable.</summary>
     public bool Cancel { get; set; }
 
     /// <summary>Gets the view-relative rectangle describing the currently visible viewport into the <see cref="View"/>.</summary>
-    public Rect Rect { get; }
+    public Rectangle Rectangle { get; }
 }
 
 /// <summary>Defines the event arguments for <see cref="View.SetFocus()"/></summary>

+ 1 - 1
Terminal.Gui/View/ViewSubViews.cs

@@ -193,7 +193,7 @@ public partial class View
             return;
         }
 
-        Rect touched = view.Frame;
+        Rectangle touched = view.Frame;
         _subviews.Remove (view);
         _tabIndexes.Remove (view);
         view._superView = null;

+ 5 - 5
Terminal.Gui/View/ViewText.cs

@@ -150,7 +150,7 @@ public partial class View
             y = Bounds.Y;
         }
 
-        Rect rect = TextFormatter.CalcRect (x, y, TextFormatter.Text, TextFormatter.Direction);
+        Rectangle rect = TextFormatter.CalcRect (x, y, TextFormatter.Text, TextFormatter.Direction);
 
         int newWidth = rect.Size.Width
                        - GetHotKeySpecifierLength ()
@@ -257,7 +257,7 @@ public partial class View
 
     private bool IsValidAutoSize (out Size autoSize)
     {
-        Rect rect = TextFormatter.CalcRect (_frame.X, _frame.Y, TextFormatter.Text, TextDirection);
+        Rectangle rect = TextFormatter.CalcRect (_frame.X, _frame.Y, TextFormatter.Text, TextDirection);
 
         autoSize = new Size (
                              rect.Size.Width - GetHotKeySpecifierLength (),
@@ -271,7 +271,7 @@ public partial class View
 
     private bool IsValidAutoSizeHeight (Dim height)
     {
-        Rect rect = TextFormatter.CalcRect (_frame.X, _frame.Y, TextFormatter.Text, TextDirection);
+        Rectangle rect = TextFormatter.CalcRect (_frame.X, _frame.Y, TextFormatter.Text, TextDirection);
         int dimValue = height.Anchor (0);
 
         return !((ValidatePosDim && !(height is Dim.DimAbsolute))
@@ -280,7 +280,7 @@ public partial class View
 
     private bool IsValidAutoSizeWidth (Dim width)
     {
-        Rect rect = TextFormatter.CalcRect (_frame.X, _frame.Y, TextFormatter.Text, TextDirection);
+        Rectangle rect = TextFormatter.CalcRect (_frame.X, _frame.Y, TextFormatter.Text, TextDirection);
         int dimValue = width.Anchor (0);
 
         return !((ValidatePosDim && !(width is Dim.DimAbsolute))
@@ -365,7 +365,7 @@ public partial class View
             // TODO: This is a hack.
             //_width  = size.Width;
             //_height = size.Height;
-            _frame = new Rect (_frame.Location, size);
+            _frame = new Rectangle (_frame.Location, size);
 
             //throw new InvalidOperationException ("This is a hack.");
             return true;

+ 3 - 3
Terminal.Gui/Views/ColorPicker.cs

@@ -157,7 +157,7 @@ public class ColorPicker : View
     }
 
     ///<inheritdoc/>
-    public override void OnDrawContent (Rect contentArea)
+    public override void OnDrawContent (Rectangle contentArea)
     {
         base.OnDrawContent (contentArea);
 
@@ -223,11 +223,11 @@ public class ColorPicker : View
 
         if (selected)
         {
-            DrawFocusRect (new Rect (x * BoxWidth, y * BoxHeight, BoxWidth, BoxHeight));
+            DrawFocusRect (new Rectangle (x * BoxWidth, y * BoxHeight, BoxWidth, BoxHeight));
         }
     }
 
-    private void DrawFocusRect (Rect rect)
+    private void DrawFocusRect (Rectangle rect)
     {
         var lc = new LineCanvas ();
 

+ 4 - 4
Terminal.Gui/Views/ComboBox.cs

@@ -284,7 +284,7 @@ public class ComboBox : View
     public virtual void OnCollapsed () { Collapsed?.Invoke (this, EventArgs.Empty); }
 
     /// <inheritdoc/>
-    public override void OnDrawContent (Rect contentArea)
+    public override void OnDrawContent (Rectangle contentArea)
     {
         base.OnDrawContent (contentArea);
 
@@ -490,7 +490,7 @@ public class ComboBox : View
             OnOpenSelectedItem ();
         }
 
-        Rect rect = _listview.BoundsToScreen (_listview.IsInitialized ? _listview.Bounds : Rect.Empty);
+        Rectangle rect = _listview.BoundsToScreen (_listview.IsInitialized ? _listview.Bounds : Rectangle.Empty);
         Reset (true);
         _listview.Clear (rect);
         _listview.TabStop = false;
@@ -839,12 +839,12 @@ public class ComboBox : View
             return res;
         }
 
-        public override void OnDrawContent (Rect contentArea)
+        public override void OnDrawContent (Rectangle contentArea)
         {
             Attribute current = ColorScheme.Focus;
             Driver.SetAttribute (current);
             Move (0, 0);
-            Rect f = Frame;
+            Rectangle f = Frame;
             int item = TopItem;
             bool focused = HasFocus;
             int col = AllowsMarking ? 2 : 0;

+ 2 - 2
Terminal.Gui/Views/FileDialog.cs

@@ -407,7 +407,7 @@ public class FileDialog : Dialog
     }
 
     /// <inheritdoc/>
-    public override void OnDrawContent (Rect contentArea)
+    public override void OnDrawContent (Rectangle contentArea)
     {
         base.OnDrawContent (contentArea);
 
@@ -516,7 +516,7 @@ public class FileDialog : Dialog
 
             _allowedTypeMenuBar.DrawContentComplete += (s, e) =>
                                                        {
-                                                           _allowedTypeMenuBar.Move (e.Rect.Width - 1, 0);
+                                                           _allowedTypeMenuBar.Move (e.Rectangle.Width - 1, 0);
                                                            Driver.AddRune (Glyphs.DownArrow);
                                                        };
 

+ 2 - 2
Terminal.Gui/Views/GraphView/Annotations.cs

@@ -108,14 +108,14 @@ public class LegendAnnotation : View, IAnnotation
     private readonly List<Tuple<GraphCellToRender, string>> _entries = new ();
 
     /// <summary>Creates a new empty legend at the empty screen coordinates.</summary>
-    public LegendAnnotation () : this (Rect.Empty) { }
+    public LegendAnnotation () : this (Rectangle.Empty) { }
 
     /// <summary>Creates a new empty legend at the given screen coordinates.</summary>
     /// <param name="legendBounds">
     ///     Defines the area available for the legend to render in (within the graph).  This is in
     ///     screen units (i.e. not graph space)
     /// </param>
-    public LegendAnnotation (Rect legendBounds)
+    public LegendAnnotation (Rectangle legendBounds)
     {
         X = legendBounds.X;
         Y = legendBounds.Y;

+ 6 - 6
Terminal.Gui/Views/GraphView/Axis.cs

@@ -140,7 +140,7 @@ public class HorizontalAxis : Axis
             return;
         }
 
-        Rect bounds = graph.Bounds;
+        Rectangle bounds = graph.Bounds;
 
         IEnumerable<AxisIncrementToRender> labels = GetLabels (graph, bounds);
 
@@ -174,7 +174,7 @@ public class HorizontalAxis : Axis
             return;
         }
 
-        Rect bounds = graph.Bounds;
+        Rectangle bounds = graph.Bounds;
 
         graph.Move (0, 0);
 
@@ -225,7 +225,7 @@ public class HorizontalAxis : Axis
         Application.Driver.AddRune (Glyphs.HLine);
     }
 
-    private IEnumerable<AxisIncrementToRender> GetLabels (GraphView graph, Rect bounds)
+    private IEnumerable<AxisIncrementToRender> GetLabels (GraphView graph, Rectangle bounds)
     {
         // if no labels
         if (Increment == 0)
@@ -317,7 +317,7 @@ public class VerticalAxis : Axis
             return;
         }
 
-        Rect bounds = graph.Bounds;
+        Rectangle bounds = graph.Bounds;
         IEnumerable<AxisIncrementToRender> labels = GetLabels (graph, bounds);
 
         foreach (AxisIncrementToRender label in labels)
@@ -356,7 +356,7 @@ public class VerticalAxis : Axis
             return;
         }
 
-        Rect bounds = graph.Bounds;
+        Rectangle bounds = graph.Bounds;
 
         int x = GetAxisXPosition (graph);
 
@@ -412,7 +412,7 @@ public class VerticalAxis : Axis
         return graph.Bounds.Height;
     }
 
-    private IEnumerable<AxisIncrementToRender> GetLabels (GraphView graph, Rect bounds)
+    private IEnumerable<AxisIncrementToRender> GetLabels (GraphView graph, Rectangle bounds)
     {
         // if no labels
         if (Increment == 0)

+ 3 - 3
Terminal.Gui/Views/GraphView/GraphView.cs

@@ -197,7 +197,7 @@ public class GraphView : View
     }
 
     ///<inheritdoc/>
-    public override void OnDrawContent (Rect contentArea)
+    public override void OnDrawContent (Rectangle contentArea)
     {
         if (CellSize.X == 0 || CellSize.Y == 0)
         {
@@ -256,7 +256,7 @@ public class GraphView : View
 
         SetDriverColorToGraphColor ();
 
-        var drawBounds = new Rect ((int)MarginLeft, 0, graphScreenWidth, graphScreenHeight);
+        var drawBounds = new Rectangle ((int)MarginLeft, 0, graphScreenWidth, graphScreenHeight);
 
         RectangleF graphSpace = ScreenToGraphSpace (drawBounds);
 
@@ -325,7 +325,7 @@ public class GraphView : View
     /// <summary>Returns the section of the graph that is represented by the screen area.</summary>
     /// <param name="screenArea"></param>
     /// <returns></returns>
-    public RectangleF ScreenToGraphSpace (Rect screenArea)
+    public RectangleF ScreenToGraphSpace (Rectangle screenArea)
     {
         // get position of the bottom left
         RectangleF pos = ScreenToGraphSpace (screenArea.Left, screenArea.Bottom - 1);

+ 4 - 4
Terminal.Gui/Views/GraphView/Series.cs

@@ -12,7 +12,7 @@ public interface ISeries
     /// <param name="graph">Graph series is to be drawn onto</param>
     /// <param name="drawBounds">Visible area of the graph in Console Screen units (excluding margins)</param>
     /// <param name="graphBounds">Visible area of the graph in Graph space units</param>
-    void DrawSeries (GraphView graph, Rect drawBounds, RectangleF graphBounds);
+    void DrawSeries (GraphView graph, Rectangle drawBounds, RectangleF graphBounds);
 }
 
 /// <summary>Series composed of any number of discrete data points</summary>
@@ -29,7 +29,7 @@ public class ScatterSeries : ISeries
     public List<PointF> Points { get; set; } = new ();
 
     /// <summary>Draws all points directly onto the graph</summary>
-    public void DrawSeries (GraphView graph, Rect drawBounds, RectangleF graphBounds)
+    public void DrawSeries (GraphView graph, Rectangle drawBounds, RectangleF graphBounds)
     {
         if (Fill.Color.HasValue)
         {
@@ -105,7 +105,7 @@ public class MultiBarSeries : ISeries
     /// <param name="graph"></param>
     /// <param name="drawBounds"></param>
     /// <param name="graphBounds"></param>
-    public void DrawSeries (GraphView graph, Rect drawBounds, RectangleF graphBounds)
+    public void DrawSeries (GraphView graph, Rectangle drawBounds, RectangleF graphBounds)
     {
         foreach (BarSeries bar in subSeries)
         {
@@ -172,7 +172,7 @@ public class BarSeries : ISeries
     /// <param name="graph"></param>
     /// <param name="drawBounds">Screen area of the graph excluding margins</param>
     /// <param name="graphBounds">Graph space area that should be drawn into <paramref name="drawBounds"/></param>
-    public virtual void DrawSeries (GraphView graph, Rect drawBounds, RectangleF graphBounds)
+    public virtual void DrawSeries (GraphView graph, Rectangle drawBounds, RectangleF graphBounds)
     {
         for (var i = 0; i < Bars.Count; i++)
         {

+ 4 - 4
Terminal.Gui/Views/HexView.cs

@@ -344,7 +344,7 @@ public class HexView : View
     }
 
     ///<inheritdoc/>
-    public override void OnDrawContent (Rect contentArea)
+    public override void OnDrawContent (Rectangle contentArea)
     {
         Attribute currentAttribute;
         Attribute current = ColorScheme.Focus;
@@ -352,7 +352,7 @@ public class HexView : View
         Move (0, 0);
 
         // BUGBUG: Bounds!!!!
-        Rect frame = Frame;
+        Rectangle frame = Frame;
 
         int nblocks = bytesPerLine / bsize;
         var data = new byte [nblocks * bsize * frame.Height];
@@ -364,7 +364,7 @@ public class HexView : View
 
         for (var line = 0; line < frame.Height; line++)
         {
-            var lineRect = new Rect (0, line, frame.Width, 1);
+            var lineRect = new Rectangle (0, line, frame.Width, 1);
 
             if (!Bounds.Contains (lineRect))
             {
@@ -787,7 +787,7 @@ public class HexView : View
         int line = delta / bytesPerLine;
 
         // BUGBUG: Bounds!
-        SetNeedsDisplay (new Rect (0, line, Frame.Width, 1));
+        SetNeedsDisplay (new Rectangle (0, line, Frame.Width, 1));
     }
 
     private bool ToggleSide ()

+ 2 - 2
Terminal.Gui/Views/Line.cs

@@ -15,7 +15,7 @@ public class Line : View
     /// <inheritdoc/>
     public override bool OnDrawAdornments ()
     {
-        Rect screenBounds = BoundsToScreen (Bounds);
+        Rectangle screenBounds = BoundsToScreen (Bounds);
         LineCanvas lc;
 
         lc = SuperView?.LineCanvas;
@@ -37,5 +37,5 @@ public class Line : View
     //}
 
     /// <inheritdoc/>
-    public override void OnDrawContent (Rect contentArea) { OnDrawAdornments (); }
+    public override void OnDrawContent (Rectangle contentArea) { OnDrawAdornments (); }
 }

+ 1 - 1
Terminal.Gui/Views/LineView.cs

@@ -54,7 +54,7 @@ public class LineView : View
     public Rune? StartingAnchor { get; set; }
 
     /// <summary>Draws the line including any starting/ending anchors</summary>
-    public override void OnDrawContent (Rect contentArea)
+    public override void OnDrawContent (Rectangle contentArea)
     {
         base.OnDrawContent (contentArea);
 

+ 2 - 2
Terminal.Gui/Views/ListView.cs

@@ -616,14 +616,14 @@ public class ListView : View
     }
 
     /// <inheritdoc/>
-    public override void OnDrawContent (Rect contentArea)
+    public override void OnDrawContent (Rectangle contentArea)
     {
         base.OnDrawContent (contentArea);
 
         Attribute current = ColorScheme.Focus;
         Driver.SetAttribute (current);
         Move (0, 0);
-        Rect f = Bounds;
+        Rectangle f = Bounds;
         int item = _top;
         bool focused = HasFocus;
         int col = _allowsMarking ? 2 : 0;

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

@@ -142,7 +142,7 @@ public sealed class ContextMenu : IDisposable
 
         _container = Application.Current;
         _container.Closing += Container_Closing;
-        Rect frame = Application.Driver.Bounds;
+        Rectangle frame = Application.Driver.Bounds;
         Point position = Position;
 
         if (Host is { })
@@ -157,7 +157,7 @@ public sealed class ContextMenu : IDisposable
             }
         }
 
-        Rect rect = Menu.MakeFrame (position.X, position.Y, MenuItems.Children);
+        Rectangle rect = Menu.MakeFrame (position.X, position.Y, MenuItems.Children);
 
         if (rect.Right >= frame.Right)
         {

+ 8 - 8
Terminal.Gui/Views/Menu/Menu.cs

@@ -298,11 +298,11 @@ internal sealed class Menu : View
     internal int _currentChild;
     internal View _previousSubFocused;
 
-    internal static Rect MakeFrame (int x, int y, MenuItem [] items, Menu parent = null)
+    internal static Rectangle MakeFrame (int x, int y, MenuItem [] items, Menu parent = null)
     {
         if (items is null || items.Length == 0)
         {
-            return new Rect ();
+            return new Rectangle ();
         }
 
         int minX = x;
@@ -321,7 +321,7 @@ internal sealed class Menu : View
             minY = Math.Max (Driver.Rows - maxH, 0);
         }
 
-        return new Rect (minX, minY, maxW, maxH);
+        return new Rectangle (minX, minY, maxW, maxH);
     }
 
     internal required MenuBar Host
@@ -766,15 +766,15 @@ internal sealed class Menu : View
         return !item.IsEnabled () ? ColorScheme.Disabled : GetNormalColor ();
     }
 
-    public override void OnDrawContent (Rect contentArea)
+    public override void OnDrawContent (Rectangle contentArea)
     {
         if (_barItems.Children is null)
         {
             return;
         }
 
-        Rect savedClip = Driver.Clip;
-        Driver.Clip = new Rect (0, 0, Driver.Cols, Driver.Rows);
+        Rectangle savedClip = Driver.Clip;
+        Driver.Clip = new Rectangle (0, 0, Driver.Cols, Driver.Rows);
         Driver.SetAttribute (GetNormalColor ());
 
         OnDrawAdornments ();
@@ -903,10 +903,10 @@ internal sealed class Menu : View
 
                     // The -3 is left/right border + one space (not sure what for)
                     tf.Draw (
-                             BoundsToScreen (new Rect (1, i, Frame.Width - 3, 1)),
+                             BoundsToScreen (new Rectangle (1, i, Frame.Width - 3, 1)),
                              i == _currentChild ? ColorScheme.Focus : GetNormalColor (),
                              i == _currentChild ? ColorScheme.HotFocus : ColorScheme.HotNormal,
-                             SuperView?.BoundsToScreen (SuperView.Bounds) ?? default (Rect)
+                             SuperView?.BoundsToScreen (SuperView.Bounds) ?? default (Rectangle)
                             );
                 }
                 else

+ 4 - 4
Terminal.Gui/Views/Menu/MenuBar.cs

@@ -469,7 +469,7 @@ public class MenuBar : View
     public event EventHandler<MenuOpeningEventArgs> MenuOpening;
 
     /// <inheritdoc/>
-    public override void OnDrawContent (Rect contentArea)
+    public override void OnDrawContent (Rectangle contentArea)
     {
         Move (0, 0);
         Driver.SetAttribute (GetNormalColor ());
@@ -825,7 +825,7 @@ public class MenuBar : View
             return Point.Empty;
         }
 
-        Rect superViewFrame = SuperView is null ? Driver.Bounds : SuperView.Frame;
+        Rectangle superViewFrame = SuperView is null ? Driver.Bounds : SuperView.Frame;
         View sv = SuperView is null ? Application.Current : SuperView;
         Point boundsOffset = sv.GetBoundsOffset ();
 
@@ -842,8 +842,8 @@ public class MenuBar : View
     /// <returns>The location offset.</returns>
     internal Point GetScreenOffsetFromCurrent ()
     {
-        Rect screen = Driver.Bounds;
-        Rect currentFrame = Application.Current.Frame;
+        Rectangle screen = Driver.Bounds;
+        Rectangle currentFrame = Application.Current.Frame;
         Point boundsOffset = Application.Top.GetBoundsOffset ();
 
         return new Point (screen.X - currentFrame.X - boundsOffset.X, screen.Y - currentFrame.Y - boundsOffset.Y);

+ 1 - 1
Terminal.Gui/Views/MessageBox.cs

@@ -394,7 +394,7 @@ public static class MessageBox
                         }
 
                         // TODO: replace with Dim.Fit when implemented
-                        Rect maxBounds = d.SuperView?.Bounds ?? Application.Top.Bounds;
+                        Rectangle maxBounds = d.SuperView?.Bounds ?? Application.Top.Bounds;
 
                         if (wrapMessage)
                         {

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

@@ -143,7 +143,7 @@ public class ProgressBar : View
     }
 
     ///<inheritdoc/>
-    public override void OnDrawContent (Rect contentArea)
+    public override void OnDrawContent (Rectangle contentArea)
     {
         Driver.SetAttribute (GetHotNormalColor ());
 
@@ -193,7 +193,7 @@ public class ProgressBar : View
                       BoundsToScreen (Bounds),
                       attr,
                       ColorScheme.Normal,
-                      SuperView?.BoundsToScreen (SuperView.Bounds) ?? default (Rect)
+                      SuperView?.BoundsToScreen (SuperView.Bounds) ?? default (Rectangle)
                      );
         }
     }

+ 5 - 5
Terminal.Gui/Views/RadioGroup.cs

@@ -201,7 +201,7 @@ public class RadioGroup : View
     }
 
     /// <inheritdoc/>
-    public override void OnDrawContent (Rect contentArea)
+    public override void OnDrawContent (Rectangle contentArea)
     {
         base.OnDrawContent (contentArea);
 
@@ -396,11 +396,11 @@ public class RadioGroup : View
         }
     }
 
-    private static Rect MakeRect (int x, int y, List<string> radioLabels)
+    private static Rectangle MakeRect (int x, int y, List<string> radioLabels)
     {
         if (radioLabels is null)
         {
-            return new Rect (x, y, 0, 0);
+            return new Rectangle (x, y, 0, 0);
         }
 
         var width = 0;
@@ -410,7 +410,7 @@ public class RadioGroup : View
             width = Math.Max (s.GetColumns () + 2, width);
         }
 
-        return new Rect (x, y, width, radioLabels.Count);
+        return new Rectangle (x, y, width, radioLabels.Count);
     }
 
     private void MoveDown ()
@@ -452,7 +452,7 @@ public class RadioGroup : View
         switch (_orientation)
         {
             case Orientation.Vertical:
-                Rect r = MakeRect (0, 0, radioLabels);
+                Rectangle r = MakeRect (0, 0, radioLabels);
 
                 if (IsInitialized)
                 {

+ 1 - 1
Terminal.Gui/Views/ScrollBarView.cs

@@ -449,7 +449,7 @@ public class ScrollBarView : View
     public virtual void OnChangedPosition () { ChangedPosition?.Invoke (this, EventArgs.Empty); }
 
     /// <inheritdoc/>
-    public override void OnDrawContent (Rect contentArea)
+    public override void OnDrawContent (Rectangle contentArea)
     {
         if (ColorScheme is null || ((!_showScrollIndicator || Size == 0) && AutoHideScrollBars && Visible))
         {

+ 5 - 5
Terminal.Gui/Views/ScrollView.cs

@@ -126,7 +126,7 @@ public class ScrollView : View
                            }
 
                            SetContentOffset (_contentOffset);
-                           _contentView.Frame = new Rect (ContentOffset, ContentSize);
+                           _contentView.Frame = new Rectangle (ContentOffset, ContentSize);
                            _vertical.ChangedPosition += delegate { ContentOffset = new Point (ContentOffset.X, _vertical.Position); };
                            _horizontal.ChangedPosition += delegate { ContentOffset = new Point (_horizontal.Position, ContentOffset.Y); };
                        };
@@ -187,7 +187,7 @@ public class ScrollView : View
             if (_contentSize != value)
             {
                 _contentSize = value;
-                _contentView.Frame = new Rect (_contentOffset, value);
+                _contentView.Frame = new Rectangle (_contentOffset, value);
                 _vertical.Size = _contentSize.Height;
                 _horizontal.Size = _contentSize.Width;
                 SetNeedsDisplay ();
@@ -380,11 +380,11 @@ public class ScrollView : View
     }
 
     /// <inheritdoc/>
-    public override void OnDrawContent (Rect contentArea)
+    public override void OnDrawContent (Rectangle contentArea)
     {
         SetViewsNeedsDisplay ();
 
-        Rect savedClip = ClipToBounds ();
+        Rectangle savedClip = ClipToBounds ();
 
         // TODO: It's bad practice for views to always clear a view. It negates clipping.
         Clear ();
@@ -590,7 +590,7 @@ public class ScrollView : View
     private void SetContentOffset (Point offset)
     {
         _contentOffset = new Point (-Math.Abs (offset.X), -Math.Abs (offset.Y));
-        _contentView.Frame = new Rect (_contentOffset, _contentSize);
+        _contentView.Frame = new Rectangle (_contentOffset, _contentSize);
         int p = Math.Max (0, -_contentOffset.Y);
 
         if (_vertical.Position != p)

+ 3 - 3
Terminal.Gui/Views/Slider.cs

@@ -775,7 +775,7 @@ public class Slider<T> : View
 
         if (_config._sliderOrientation == Orientation.Horizontal)
         {
-            Bounds = new Rect (
+            Bounds = new Rectangle (
                                Bounds.Location,
                                new Size (
                                          int.Min (
@@ -791,7 +791,7 @@ public class Slider<T> : View
         }
         else
         {
-            Bounds = new Rect (
+            Bounds = new Rectangle (
                                Bounds.Location,
                                new Size (
                                          int.Min (
@@ -994,7 +994,7 @@ public class Slider<T> : View
     }
 
     /// <inheritdoc/>
-    public override void OnDrawContent (Rect contentArea)
+    public override void OnDrawContent (Rectangle contentArea)
     {
         // TODO: make this more surgical to reduce repaint
 

+ 1 - 1
Terminal.Gui/Views/StatusBar.cs

@@ -172,7 +172,7 @@ public class StatusBar : View
     }
 
     ///<inheritdoc/>
-    public override void OnDrawContent (Rect contentArea)
+    public override void OnDrawContent (Rectangle contentArea)
     {
         Move (0, 0);
         Driver.SetAttribute (GetNormalColor ());

+ 8 - 8
Terminal.Gui/Views/TabView.cs

@@ -311,13 +311,13 @@ public class TabView : View
     public int EnsureValidScrollOffsets (int value) { return Math.Max (Math.Min (value, Tabs.Count - 1), 0); }
 
     /// <inheritdoc/>
-    public override void OnDrawContent (Rect contentArea)
+    public override void OnDrawContent (Rectangle contentArea)
     {
         Driver.SetAttribute (GetNormalColor ());
 
         if (Tabs.Any ())
         {
-            Rect savedClip = ClipToBounds ();
+            Rectangle savedClip = ClipToBounds ();
             _tabsBar.OnDrawContent (contentArea);
             _contentView.SetNeedsDisplay ();
             _contentView.Draw ();
@@ -326,7 +326,7 @@ public class TabView : View
     }
 
     /// <inheritdoc/>
-    public override void OnDrawContentComplete (Rect contentArea) { _tabsBar.OnDrawContentComplete (contentArea); }
+    public override void OnDrawContentComplete (Rectangle contentArea) { _tabsBar.OnDrawContentComplete (contentArea); }
 
     /// <summary>
     ///     Removes the given <paramref name="tab"/> from <see cref="Tabs"/>. Caller is responsible for disposing the
@@ -437,7 +437,7 @@ public class TabView : View
 
     /// <summary>Returns which tabs to render at each x location.</summary>
     /// <returns></returns>
-    private IEnumerable<TabToRender> CalculateViewport (Rect bounds)
+    private IEnumerable<TabToRender> CalculateViewport (Rectangle bounds)
     {
         UnSetCurrentTabs ();
 
@@ -657,7 +657,7 @@ public class TabView : View
             return false;
         }
 
-        public override void OnDrawContent (Rect contentArea)
+        public override void OnDrawContent (Rectangle contentArea)
         {
             _host._tabLocations = _host.CalculateViewport (Bounds).ToArray ();
 
@@ -670,7 +670,7 @@ public class TabView : View
             Driver.SetAttribute (GetNormalColor ());
         }
 
-        public override void OnDrawContentComplete (Rect contentArea)
+        public override void OnDrawContentComplete (Rectangle contentArea)
         {
             if (_host._tabLocations is null)
             {
@@ -683,7 +683,7 @@ public class TabView : View
             for (var i = 0; i < tabLocations.Length; i++)
             {
                 View tab = tabLocations [i].Tab;
-                Rect vts = tab.BoundsToScreen (tab.Bounds);
+                Rectangle vts = tab.BoundsToScreen (tab.Bounds);
                 var lc = new LineCanvas ();
                 int selectedOffset = _host.Style.ShowTopLine && tabLocations [i].IsSelected ? 0 : 1;
 
@@ -1115,7 +1115,7 @@ public class TabView : View
 
                     int lastSelectedTab = !_host.Style.ShowTopLine && i == selectedTab ? 1 :
                                           _host.Style.TabsOnBottom ? 1 : 0;
-                    Rect tabsBarVts = BoundsToScreen (Bounds);
+                    Rectangle tabsBarVts = BoundsToScreen (Bounds);
                     int lineLength = tabsBarVts.Right - vts.Right;
 
                     // Right horizontal line

+ 1 - 1
Terminal.Gui/Views/TableView/ListTableSource.cs

@@ -16,7 +16,7 @@ public class ListTableSource : ITableSource
     public ListColumnStyle Style;
 
     private readonly TableView _tableView;
-    private Rect _lastBounds;
+    private Rectangle _lastBounds;
     private IList _lastList;
     private int _lastMaxCellWidth;
     private int _lastMinCellWidth;

+ 4 - 4
Terminal.Gui/Views/TableView/TableSelection.cs

@@ -6,10 +6,10 @@ public class TableSelection
     /// <summary>Creates a new selected area starting at the origin corner and covering the provided rectangular area</summary>
     /// <param name="origin"></param>
     /// <param name="rect"></param>
-    public TableSelection (Point origin, Rect rect)
+    public TableSelection (Point origin, Rectangle rect)
     {
         Origin = origin;
-        Rect = rect;
+        Rectangle = rect;
     }
 
     /// <summary>
@@ -18,11 +18,11 @@ public class TableSelection
     /// </summary>
     public bool IsToggled { get; set; }
 
-    /// <summary>Corner of the <see cref="Rect"/> where selection began</summary>
+    /// <summary>Corner of the <see cref="Rectangle"/> where selection began</summary>
     /// <value></value>
     public Point Origin { get; set; }
 
     /// <summary>Area selected</summary>
     /// <value></value>
-    public Rect Rect { get; set; }
+    public Rectangle Rectangle { get; set; }
 }

+ 18 - 18
Terminal.Gui/Views/TableView/TableView.cs

@@ -674,13 +674,13 @@ public class TableView : View
         foreach (TableSelection region in oldRegions)
         {
             // ignore regions entirely below current table state
-            if (region.Rect.Top >= Table.Rows)
+            if (region.Rectangle.Top >= Table.Rows)
             {
                 continue;
             }
 
             // ignore regions entirely too far right of table columns
-            if (region.Rect.Left >= Table.Columns)
+            if (region.Rectangle.Left >= Table.Columns)
             {
                 continue;
             }
@@ -692,11 +692,11 @@ public class TableView : View
                                       );
 
             // ensure regions do not go over edge of table bounds
-            region.Rect = Rect.FromLTRB (
-                                         region.Rect.Left,
-                                         region.Rect.Top,
-                                         Math.Max (Math.Min (region.Rect.Right, Table.Columns), 0),
-                                         Math.Max (Math.Min (region.Rect.Bottom, Table.Rows), 0)
+            region.Rectangle = Rectangle.FromLTRB (
+                                         region.Rectangle.Left,
+                                         region.Rectangle.Top,
+                                         Math.Max (Math.Min (region.Rectangle.Right, Table.Columns), 0),
+                                         Math.Max (Math.Min (region.Rectangle.Bottom, Table.Rows), 0)
                                         );
 
             MultiSelectedRegions.Push (region);
@@ -723,11 +723,11 @@ public class TableView : View
         if (MultiSelect && MultiSelectedRegions.Any ())
         {
             // Quiz any cells for whether they are selected.  For performance we only need to check those between the top left and lower right vertex of selection regions
-            int yMin = MultiSelectedRegions.Min (r => r.Rect.Top);
-            int yMax = MultiSelectedRegions.Max (r => r.Rect.Bottom);
+            int yMin = MultiSelectedRegions.Min (r => r.Rectangle.Top);
+            int yMax = MultiSelectedRegions.Max (r => r.Rectangle.Bottom);
 
-            int xMin = FullRowSelect ? 0 : MultiSelectedRegions.Min (r => r.Rect.Left);
-            int xMax = FullRowSelect ? Table.Columns : MultiSelectedRegions.Max (r => r.Rect.Right);
+            int xMin = FullRowSelect ? 0 : MultiSelectedRegions.Min (r => r.Rectangle.Left);
+            int xMax = FullRowSelect ? Table.Columns : MultiSelectedRegions.Max (r => r.Rectangle.Right);
 
             for (int y = yMin; y < yMax; y++)
             {
@@ -896,7 +896,7 @@ public class TableView : View
     }
 
     ///<inheritdoc/>
-    public override void OnDrawContent (Rect contentArea)
+    public override void OnDrawContent (Rectangle contentArea)
     {
         base.OnDrawContent (contentArea);
 
@@ -1124,7 +1124,7 @@ public class TableView : View
         MultiSelectedRegions.Push (
                                    new TableSelection (
                                                        new Point (SelectedColumn, SelectedRow),
-                                                       new Rect (0, 0, Table.Columns, table.Rows)
+                                                       new Rectangle (0, 0, Table.Columns, table.Rows)
                                                       )
                                   );
         Update ();
@@ -1335,7 +1335,7 @@ public class TableView : View
     /// <param name="bounds"></param>
     /// <param name="padding"></param>
     /// <returns></returns>
-    private IEnumerable<ColumnToRender> CalculateViewport (Rect bounds, int padding = 1)
+    private IEnumerable<ColumnToRender> CalculateViewport (Rectangle bounds, int padding = 1)
     {
         if (TableIsNullOrInvisible ())
         {
@@ -1499,7 +1499,7 @@ public class TableView : View
         int right = Math.Max (Math.Max (pt1X, pt2X), 0);
 
         // Rect class is inclusive of Top Left but exclusive of Bottom Right so extend by 1
-        return new TableSelection (new Point (pt1X, pt1Y), new Rect (left, top, right - left + 1, bot - top + 1))
+        return new TableSelection (new Point (pt1X, pt1Y), new Rectangle (left, top, right - left + 1, bot - top + 1))
         {
             IsToggled = toggle
         };
@@ -1546,10 +1546,10 @@ public class TableView : View
 
         if (FullRowSelect)
         {
-            return MultiSelectedRegions.Where (r => r.Rect.Bottom > row && r.Rect.Top <= row);
+            return MultiSelectedRegions.Where (r => r.Rectangle.Bottom > row && r.Rectangle.Top <= row);
         }
 
-        return MultiSelectedRegions.Where (r => r.Rect.Contains (col, row));
+        return MultiSelectedRegions.Where (r => r.Rectangle.Contains (col, row));
     }
 
     /// <summary>
@@ -2236,7 +2236,7 @@ public class TableView : View
         public bool IsVeryLast { get; }
 
         /// <summary>
-        ///     The width that the column should occupy as calculated by <see cref="CalculateViewport(Rect, int)"/>.  Note
+        ///     The width that the column should occupy as calculated by <see cref="CalculateViewport(Rectangle, int)"/>.  Note
         ///     that this includes space for padding i.e. the separator between columns.
         /// </summary>
         public int Width { get; internal set; }

+ 3 - 3
Terminal.Gui/Views/TextField.cs

@@ -980,7 +980,7 @@ public class TextField : View
     }
 
     /// <inheritdoc/>
-    public override void OnDrawContent (Rect contentArea)
+    public override void OnDrawContent (Rectangle contentArea)
     {
         _isDrawing = true;
 
@@ -1203,8 +1203,8 @@ public class TextField : View
 
         int pos = _cursorPosition - ScrollOffset + Math.Min (Frame.X, 0);
         int offB = OffSetBackground ();
-        Rect containerFrame = SuperView?.BoundsToScreen (SuperView.Bounds) ?? default (Rect);
-        Rect thisFrame = BoundsToScreen (Bounds);
+        Rectangle containerFrame = SuperView?.BoundsToScreen (SuperView.Bounds) ?? default (Rectangle);
+        Rectangle thisFrame = BoundsToScreen (Bounds);
 
         if (pos > -1
             && col >= pos

+ 1 - 1
Terminal.Gui/Views/TextValidateField.cs

@@ -555,7 +555,7 @@ namespace Terminal.Gui
         }
 
         /// <inheritdoc/>
-        public override void OnDrawContent (Rect contentArea)
+        public override void OnDrawContent (Rectangle contentArea)
         {
             if (_provider is null)
             {

+ 8 - 8
Terminal.Gui/Views/TextView.cs

@@ -3593,7 +3593,7 @@ public class TextView : View
     }
 
     /// <inheritdoc/>
-    public override void OnDrawContent (Rect contentArea)
+    public override void OnDrawContent (Rectangle contentArea)
     {
         _isDrawing = true;
 
@@ -4495,7 +4495,7 @@ public class TextView : View
                 _wrapNeeded = true;
             }
 
-            DoSetNeedsDisplay (new Rect (0, CurrentRow - _topRow, Frame.Width, CurrentRow - _topRow + 1));
+            DoSetNeedsDisplay (new Rectangle (0, CurrentRow - _topRow, Frame.Width, CurrentRow - _topRow + 1));
         }
         else
         {
@@ -4515,7 +4515,7 @@ public class TextView : View
             }
 
             DoSetNeedsDisplay (
-                               new Rect (
+                               new Rectangle (
                                          CurrentColumn - _leftColumn,
                                          CurrentRow - _topRow,
                                          Frame.Width,
@@ -4541,7 +4541,7 @@ public class TextView : View
         }
     }
 
-    private void DoSetNeedsDisplay (Rect rect)
+    private void DoSetNeedsDisplay (Rectangle rect)
     {
         if (_wrapNeeded)
         {
@@ -5076,7 +5076,7 @@ public class TextView : View
 
         UpdateWrapModel ();
 
-        DoSetNeedsDisplay (new Rect (0, CurrentRow - _topRow, Frame.Width, Frame.Height));
+        DoSetNeedsDisplay (new Rectangle (0, CurrentRow - _topRow, Frame.Width, Frame.Height));
 
         _lastWasKill = setLastWasKill;
         DoNeededAction ();
@@ -5181,7 +5181,7 @@ public class TextView : View
 
         UpdateWrapModel ();
 
-        DoSetNeedsDisplay (new Rect (0, CurrentRow - _topRow, Frame.Width, Frame.Height));
+        DoSetNeedsDisplay (new Rectangle (0, CurrentRow - _topRow, Frame.Width, Frame.Height));
 
         _lastWasKill = setLastWasKill;
         DoNeededAction ();
@@ -5251,7 +5251,7 @@ public class TextView : View
 
         UpdateWrapModel ();
 
-        DoSetNeedsDisplay (new Rect (0, CurrentRow - _topRow, Frame.Width, Frame.Height));
+        DoSetNeedsDisplay (new Rectangle (0, CurrentRow - _topRow, Frame.Width, Frame.Height));
         DoNeededAction ();
     }
 
@@ -5310,7 +5310,7 @@ public class TextView : View
 
         UpdateWrapModel ();
 
-        DoSetNeedsDisplay (new Rect (0, CurrentRow - _topRow, Frame.Width, Frame.Height));
+        DoSetNeedsDisplay (new Rectangle (0, CurrentRow - _topRow, Frame.Width, Frame.Height));
         DoNeededAction ();
     }
 

+ 5 - 5
Terminal.Gui/Views/TileView.cs

@@ -156,11 +156,11 @@ public class TileView : View
             return;
         }
 
-        Rect contentArea = Bounds;
+        Rectangle contentArea = Bounds;
 
         if (HasBorder ())
         {
-            contentArea = new Rect (
+            contentArea = new Rectangle (
                                     contentArea.X + 1,
                                     contentArea.Y + 1,
                                     Math.Max (0, contentArea.Width - 2),
@@ -177,7 +177,7 @@ public class TileView : View
     public override bool OnDrawAdornments () { return false; }
 
     /// <inheritdoc/>
-    public override void OnDrawContent (Rect contentArea)
+    public override void OnDrawContent (Rectangle contentArea)
     {
         Driver.SetAttribute (ColorScheme.Normal);
         Clear ();
@@ -756,7 +756,7 @@ public class TileView : View
         return false;
     }
 
-    private void Setup (Rect contentArea)
+    private void Setup (Rectangle contentArea)
     {
         if (contentArea.IsEmpty || contentArea.Height <= 0 || contentArea.Width <= 0)
         {
@@ -969,7 +969,7 @@ public class TileView : View
             return false;
         }
 
-        public override void OnDrawContent (Rect contentArea)
+        public override void OnDrawContent (Rectangle contentArea)
         {
             base.OnDrawContent (contentArea);
 

+ 1 - 1
Terminal.Gui/Views/Toplevel.cs

@@ -347,7 +347,7 @@ public partial class Toplevel : View
     }
 
     /// <inheritdoc/>
-    public override void OnDrawContent (Rect contentArea)
+    public override void OnDrawContent (Rectangle contentArea)
     {
         if (!Visible)
         {

+ 1 - 1
Terminal.Gui/Views/TreeView/TreeView.cs

@@ -1142,7 +1142,7 @@ public class TreeView<T> : View, ITreeView where T : class
     public event EventHandler<ObjectActivatedEventArgs<T>> ObjectActivated;
 
     ///<inheritdoc/>
-    public override void OnDrawContent (Rect contentArea)
+    public override void OnDrawContent (Rectangle contentArea)
     {
         if (roots is null)
         {

+ 3 - 2
UICatalog/Scenarios/Animation.cs

@@ -7,6 +7,7 @@ using SixLabors.ImageSharp;
 using SixLabors.ImageSharp.PixelFormats;
 using SixLabors.ImageSharp.Processing;
 using Terminal.Gui;
+using Rectangle = Terminal.Gui.Rectangle;
 
 namespace UICatalog.Scenarios;
 
@@ -160,10 +161,10 @@ public class Animation : Scenario
         private int frameCount;
         private Image<Rgba32> [] fullResImages;
         private Image<Rgba32> [] matchSizes;
-        private Rect oldSize = Rect.Empty;
+        private Rectangle oldSize = Rectangle.Empty;
         public void NextFrame () { currentFrame = (currentFrame + 1) % frameCount; }
 
-        public override void OnDrawContent (Rect contentArea)
+        public override void OnDrawContent (Rectangle contentArea)
         {
             base.OnDrawContent (contentArea);
 

+ 2 - 2
UICatalog/Scenarios/Buttons.cs

@@ -183,7 +183,7 @@ public class Buttons : Scenario
 
         moveBtnA.Accept += (s, e) =>
                             {
-                                moveBtnA.Frame = new Rect (
+                                moveBtnA.Frame = new Rectangle (
                                                            moveBtnA.Frame.X + 5,
                                                            moveBtnA.Frame.Y,
                                                            moveBtnA.Frame.Width,
@@ -200,7 +200,7 @@ public class Buttons : Scenario
 
         sizeBtnA.Accept += (s, e) =>
                             {
-                                sizeBtnA.Frame = new Rect (
+                                sizeBtnA.Frame = new Rectangle (
                                                            sizeBtnA.Frame.X,
                                                            sizeBtnA.Frame.Y,
                                                            sizeBtnA.Frame.Width + 5,

+ 6 - 6
UICatalog/Scenarios/CharacterMap.cs

@@ -524,7 +524,7 @@ internal class CharMap : ScrollView
     private static int RowWidth => RowLabelWidth + COLUMN_WIDTH * 16;
     public event EventHandler<ListViewItemEventArgs> Hover;
 
-    public override void OnDrawContent (Rect contentArea)
+    public override void OnDrawContent (Rectangle contentArea)
     {
         //if (ShowHorizontalScrollIndicator && ContentSize.Height < (int)(MaxCodePoint / 16 + 2)) {
         //	//ContentSize = new Size (CharMap.RowWidth, (int)(MaxCodePoint / 16 + 2));
@@ -549,14 +549,14 @@ internal class CharMap : ScrollView
     }
 
     //public void CharMap_DrawContent (object s, DrawEventArgs a)
-    public override void OnDrawContentComplete (Rect contentArea)
+    public override void OnDrawContentComplete (Rectangle contentArea)
     {
         if (contentArea.Height == 0 || contentArea.Width == 0)
         {
             return;
         }
 
-        var viewport = new Rect (
+        var viewport = new Rectangle (
                                  ContentOffset,
                                  new Size (
                                            Math.Max (Bounds.Width - (ShowVerticalScrollIndicator ? 1 : 0), 0),
@@ -564,12 +564,12 @@ internal class CharMap : ScrollView
                                           )
                                 );
 
-        Rect oldClip = ClipToBounds ();
+        Rectangle oldClip = ClipToBounds ();
 
         if (ShowHorizontalScrollIndicator)
         {
             // ClipToBounds doesn't know about the scroll indicators, so if off, subtract one from height
-            Driver.Clip = new Rect (
+            Driver.Clip = new Rectangle (
                                     Driver.Clip.Location,
                                     new Size (Driver.Clip.Width, Driver.Clip.Height - 1)
                                    );
@@ -578,7 +578,7 @@ internal class CharMap : ScrollView
         if (ShowVerticalScrollIndicator)
         {
             // ClipToBounds doesn't know about the scroll indicators, so if off, subtract one from width
-            Driver.Clip = new Rect (
+            Driver.Clip = new Rectangle (
                                     Driver.Clip.Location,
                                     new Size (Driver.Clip.Width - 1, Driver.Clip.Height)
                                    );

+ 1 - 1
UICatalog/Scenarios/GraphViewExample.cs

@@ -254,7 +254,7 @@ public class GraphViewExample : Scenario
 
         _graphView.AxisY.Minimum = 0;
 
-        var legend = new LegendAnnotation (new Rect (_graphView.Bounds.Width - 20, 0, 20, 5));
+        var legend = new LegendAnnotation (new Rectangle (_graphView.Bounds.Width - 20, 0, 20, 5));
 
         legend.AddEntry (
                          new GraphCellToRender (stiple, series.SubSeries.ElementAt (0).OverrideBarColor),

+ 2 - 1
UICatalog/Scenarios/Images.cs

@@ -7,6 +7,7 @@ using SixLabors.ImageSharp.PixelFormats;
 using SixLabors.ImageSharp.Processing;
 using Terminal.Gui;
 using Color = Terminal.Gui.Color;
+using Rectangle = Terminal.Gui.Rectangle;
 
 namespace UICatalog.Scenarios;
 
@@ -105,7 +106,7 @@ public class Images : Scenario
         private Image<Rgba32> _fullResImage;
         private Image<Rgba32> _matchSize;
 
-        public override void OnDrawContent (Rect bounds)
+        public override void OnDrawContent (Rectangle bounds)
         {
             base.OnDrawContent (bounds);
 

+ 1 - 1
UICatalog/Scenarios/LineDrawing.cs

@@ -36,7 +36,7 @@ public class LineDrawing : Scenario
         public DrawingArea () { AddLayer (); }
         public LineStyle LineStyle { get; set; }
 
-        public override void OnDrawContentComplete (Rect contentArea)
+        public override void OnDrawContentComplete (Rectangle contentArea)
         {
             base.OnDrawContentComplete (contentArea);
 

+ 1 - 1
UICatalog/Scenarios/ProgressBarStyles.cs

@@ -70,7 +70,7 @@ public class ProgressBarStyles : Scenario
                                          dialog.X = pbList.Frame.X;
                                          dialog.Y = pbList.Frame.Height;
 
-                                         dialog.Bounds = new Rect (0, 0, colorPicker.Frame.Width, colorPicker.Frame.Height);
+                                         dialog.Bounds = new Rectangle (0, 0, colorPicker.Frame.Width, colorPicker.Frame.Height);
 
                                          Application.Top.LayoutSubviews ();
                                      };

+ 5 - 5
UICatalog/Scenarios/Scrolling.cs

@@ -280,11 +280,11 @@ public class Scrolling : Scenario
     {
         private readonly int _h = 50;
         private readonly int _w = 40;
-        public Box10x (int x, int y) { Frame = new Rect (x, y, 20, 10); }
+        public Box10x (int x, int y) { Frame = new Rectangle (x, y, 20, 10); }
         public bool WantCursorPosition { get; set; } = false;
         public Size GetContentSize () { return new Size (_w, _h); }
 
-        public override void OnDrawContent (Rect contentArea)
+        public override void OnDrawContent (Rectangle contentArea)
         {
             //Point pos = new Point (region.X, region.Y);
             Driver.SetAttribute (ColorScheme.Focus);
@@ -315,7 +315,7 @@ public class Scrolling : Scenario
         private int _h = 50;
         private int _w = 40;
 
-        public Filler (Rect rect)
+        public Filler (Rectangle rect)
         {
             _w = rect.Width;
             _h = rect.Height;
@@ -324,10 +324,10 @@ public class Scrolling : Scenario
 
         public Size GetContentSize () { return new Size (_w, _h); }
 
-        public override void OnDrawContent (Rect contentArea)
+        public override void OnDrawContent (Rectangle contentArea)
         {
             Driver.SetAttribute (ColorScheme.Focus);
-            Rect f = Frame;
+            Rectangle f = Frame;
             _w = 0;
             _h = 0;
 

+ 1 - 1
UICatalog/Scenarios/SingleBackgroundWorker.cs

@@ -209,7 +209,7 @@ public class SingleBackgroundWorker : Scenario
 
         public StagingUIController (DateTime? start, List<string> list)
         {
-            Rect frame = Application.Top.Frame;
+            Rectangle frame = Application.Top.Frame;
             _top = new Toplevel { X = frame.X, Y = frame.Y, Width = frame.Width, Height = frame.Height };
 
             _top.KeyDown += (s, e) =>

+ 1 - 1
UICatalog/Scenarios/Snake.cs

@@ -309,7 +309,7 @@ public class Snake : Scenario
 
         public SnakeState State { get; }
 
-        public override void OnDrawContent (Rect contentArea)
+        public override void OnDrawContent (Rectangle contentArea)
         {
             base.OnDrawContent (contentArea);
 

+ 3 - 3
UnitTests/Application/ApplicationTests.cs

@@ -39,11 +39,11 @@ public class ApplicationTests
     [AutoInitShutdown]
     public void Begin_Sets_Application_Top_To_Console_Size ()
     {
-        Assert.Equal (new Rect (0, 0, 80, 25), Application.Top.Frame);
+        Assert.Equal (new Rectangle (0, 0, 80, 25), Application.Top.Frame);
         Application.Begin (Application.Top);
-        Assert.Equal (new Rect (0, 0, 80, 25), Application.Top.Frame);
+        Assert.Equal (new Rectangle (0, 0, 80, 25), Application.Top.Frame);
         ((FakeDriver)Application.Driver).SetBufferSize (5, 5);
-        Assert.Equal (new Rect (0, 0, 5, 5), Application.Top.Frame);
+        Assert.Equal (new Rectangle (0, 0, 5, 5), Application.Top.Frame);
     }
 
     [Fact]

+ 5 - 5
UnitTests/ConsoleDrivers/ClipRegionTests.cs

@@ -38,12 +38,12 @@ public class ClipRegionTests
         Assert.Equal ((Rune)'x', driver.Contents [5, 5].Rune);
 
         // Clear the contents
-        driver.FillRect (new Rect (0, 0, driver.Rows, driver.Cols), ' ');
+        driver.FillRect (new Rectangle (0, 0, driver.Rows, driver.Cols), ' ');
         Assert.Equal ((Rune)' ', driver.Contents [0, 0].Rune);
 
         // Setup the region with a single rectangle, fill screen with 'x'
-        driver.Clip = new Rect (5, 5, 5, 5);
-        driver.FillRect (new Rect (0, 0, driver.Rows, driver.Cols), 'x');
+        driver.Clip = new Rectangle (5, 5, 5, 5);
+        driver.FillRect (new Rectangle (0, 0, driver.Rows, driver.Cols), 'x');
         Assert.Equal ((Rune)' ', driver.Contents [0, 0].Rune);
         Assert.Equal ((Rune)' ', driver.Contents [4, 9].Rune);
         Assert.Equal ((Rune)'x', driver.Contents [5, 5].Rune);
@@ -66,7 +66,7 @@ public class ClipRegionTests
         Application.Init (driver);
 
         // Define a clip rectangle
-        driver.Clip = Rect.Empty;
+        driver.Clip = Rectangle.Empty;
 
         // negative
         Assert.False (driver.IsValidLocation (4, 5));
@@ -111,7 +111,7 @@ public class ClipRegionTests
         Assert.False (driver.IsValidLocation (driver.Cols, driver.Rows));
 
         // Define a clip rectangle
-        driver.Clip = new Rect (5, 5, 5, 5);
+        driver.Clip = new Rectangle (5, 5, 5, 5);
 
         // positive
         Assert.True (driver.IsValidLocation (5, 5));

+ 21 - 21
UnitTests/Drawing/LineCanvasTests.cs

@@ -293,7 +293,7 @@ public class LineCanvasTests
         View v = GetCanvas (out LineCanvas lc);
         v.Width = 10;
         v.Height = 10;
-        v.Bounds = new Rect (0, 0, 10, 10);
+        v.Bounds = new Rectangle (0, 0, 10, 10);
 
         lc.AddLine (new Point (x1, y1), len1, o1, s1);
         lc.AddLine (new Point (x2, y2), len2, o2, s2);
@@ -380,7 +380,7 @@ public class LineCanvasTests
         canvas.AddLine (new Point (x, y), length, Orientation.Horizontal, LineStyle.Single);
         canvas.AddLine (new Point (x, y), length, Orientation.Vertical, LineStyle.Single);
 
-        Assert.Equal (new Rect (expectedX, expectedY, expectedWidth, expectedHeight), canvas.Bounds);
+        Assert.Equal (new Rectangle (expectedX, expectedY, expectedWidth, expectedHeight), canvas.Bounds);
     }
 
     [InlineData (
@@ -461,7 +461,7 @@ public class LineCanvasTests
         var canvas = new LineCanvas ();
         canvas.AddLine (new Point (x, y), length, Orientation.Horizontal, LineStyle.Single);
 
-        Assert.Equal (new Rect (expectedX, expectedY, expectedWidth, expectedHeight), canvas.Bounds);
+        Assert.Equal (new Rectangle (expectedX, expectedY, expectedWidth, expectedHeight), canvas.Bounds);
     }
 
     [Fact]
@@ -483,27 +483,27 @@ public class LineCanvasTests
 
         // Add a short horiz line for ╔╡
         lc.AddLine (new Point (x, y), 2, Orientation.Horizontal, LineStyle.Double);
-        Assert.Equal (new Rect (x, y, 2, 1), lc.Bounds);
+        Assert.Equal (new Rectangle (x, y, 2, 1), lc.Bounds);
 
         //LHS line down
         lc.AddLine (new Point (x, y), height, Orientation.Vertical, LineStyle.Double);
-        Assert.Equal (new Rect (x, y, 2, 2), lc.Bounds);
+        Assert.Equal (new Rectangle (x, y, 2, 2), lc.Bounds);
 
         //Vertical line before Title, results in a ╡
         lc.AddLine (new Point (x + 1, y), 0, Orientation.Vertical, LineStyle.Single);
-        Assert.Equal (new Rect (x, y, 2, 2), lc.Bounds);
+        Assert.Equal (new Rectangle (x, y, 2, 2), lc.Bounds);
 
         //Vertical line after Title, results in a ╞
         lc.AddLine (new Point (x + 2, y), 0, Orientation.Vertical, LineStyle.Single);
-        Assert.Equal (new Rect (x, y, 3, 2), lc.Bounds);
+        Assert.Equal (new Rectangle (x, y, 3, 2), lc.Bounds);
 
         // remainder of top line
         lc.AddLine (new Point (x + 2, y), width - 1, Orientation.Horizontal, LineStyle.Double);
-        Assert.Equal (new Rect (x, y, 4, 2), lc.Bounds);
+        Assert.Equal (new Rectangle (x, y, 4, 2), lc.Bounds);
 
         //RHS line down
         lc.AddLine (new Point (x + width, y), height, Orientation.Vertical, LineStyle.Double);
-        Assert.Equal (new Rect (x, y, 4, 2), lc.Bounds);
+        Assert.Equal (new Rectangle (x, y, 4, 2), lc.Bounds);
 
         TestHelpers.AssertEqual (
                                  output,
@@ -533,27 +533,27 @@ public class LineCanvasTests
 
         // Add a short horiz line for ╔╡
         lc.AddLine (new Point (x, y), 2, Orientation.Horizontal, LineStyle.Double);
-        Assert.Equal (new Rect (x, y, 2, 1), lc.Bounds);
+        Assert.Equal (new Rectangle (x, y, 2, 1), lc.Bounds);
 
         //LHS line down
         lc.AddLine (new Point (x, y), height, Orientation.Vertical, LineStyle.Double);
-        Assert.Equal (new Rect (x, y, 2, 2), lc.Bounds);
+        Assert.Equal (new Rectangle (x, y, 2, 2), lc.Bounds);
 
         //Vertical line before Title, results in a ╡
         lc.AddLine (new Point (x + 1, y), 0, Orientation.Vertical, LineStyle.Single);
-        Assert.Equal (new Rect (x, y, 2, 2), lc.Bounds);
+        Assert.Equal (new Rectangle (x, y, 2, 2), lc.Bounds);
 
         //Vertical line after Title, results in a ╞
         lc.AddLine (new Point (x + 2, y), 0, Orientation.Vertical, LineStyle.Single);
-        Assert.Equal (new Rect (x, y, 3, 2), lc.Bounds);
+        Assert.Equal (new Rectangle (x, y, 3, 2), lc.Bounds);
 
         // remainder of top line
         lc.AddLine (new Point (x + 2, y), width - 1, Orientation.Horizontal, LineStyle.Double);
-        Assert.Equal (new Rect (x, y, 4, 2), lc.Bounds);
+        Assert.Equal (new Rectangle (x, y, 4, 2), lc.Bounds);
 
         //RHS line down
         lc.AddLine (new Point (x + width, y), height, Orientation.Vertical, LineStyle.Double);
-        Assert.Equal (new Rect (x, y, 4, 2), lc.Bounds);
+        Assert.Equal (new Rectangle (x, y, 4, 2), lc.Bounds);
 
         TestHelpers.AssertEqual (
                                  output,
@@ -570,13 +570,13 @@ public class LineCanvasTests
     {
         var lc = new LineCanvas ();
 
-        Assert.Equal (Rect.Empty, lc.Bounds);
+        Assert.Equal (Rectangle.Empty, lc.Bounds);
 
         lc.AddLine (new Point (0, 0), 2, Orientation.Horizontal, LineStyle.Double);
-        Assert.NotEqual (Rect.Empty, lc.Bounds);
+        Assert.NotEqual (Rectangle.Empty, lc.Bounds);
 
         lc.Clear ();
-        Assert.Equal (Rect.Empty, lc.Bounds);
+        Assert.Equal (Rectangle.Empty, lc.Bounds);
     }
 
     [InlineData (0, 0, Orientation.Horizontal, "─")]
@@ -873,7 +873,7 @@ public class LineCanvasTests
         //// Left Up
         //canvas.AddLine (new Point (0, 3), -3, Orientation.Vertical, LineStyle.Single);
 
-        Assert.Equal (new Rect (0, 0, 2, 2), canvas.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 2, 2), canvas.Bounds);
 
         Dictionary<Point, Rune> map = canvas.GetMap ();
         Assert.Equal (2, map.Count);
@@ -990,7 +990,7 @@ public class LineCanvasTests
         View v = GetCanvas (out LineCanvas lc);
         v.Width = 10;
         v.Height = 10;
-        v.Bounds = new Rect (0, 0, 10, 10);
+        v.Bounds = new Rectangle (0, 0, 10, 10);
 
         lc.AddLine (new Point (x1, y1), length, o1, s1);
 
@@ -1304,7 +1304,7 @@ public class LineCanvasTests
     /// <returns></returns>
     private View GetCanvas (out LineCanvas canvas, int offsetX = 0, int offsetY = 0)
     {
-        var v = new View { Width = 10, Height = 5, Bounds = new Rect (0, 0, 10, 5) };
+        var v = new View { Width = 10, Height = 5, Bounds = new Rectangle (0, 0, 10, 5) };
         Application.Top.Add (v);
         Application.Begin (Application.Top);
 

+ 4 - 4
UnitTests/Drawing/RulerTests.cs

@@ -51,7 +51,7 @@ public class RulerTests
         Application.Top.Add (f);
         Application.Begin (Application.Top);
         ((FakeDriver)Application.Driver).SetBufferSize (len + 5, 5);
-        Assert.Equal (new Rect (0, 0, len + 5, 5), f.Frame);
+        Assert.Equal (new Rectangle (0, 0, len + 5, 5), f.Frame);
 
         var r = new Ruler ();
         Assert.Equal (Orientation.Horizontal, r.Orientation);
@@ -123,7 +123,7 @@ public class RulerTests
         Application.Top.Add (f);
         Application.Begin (Application.Top);
         ((FakeDriver)Application.Driver).SetBufferSize (len + 5, 5);
-        Assert.Equal (new Rect (0, 0, len + 5, 5), f.Frame);
+        Assert.Equal (new Rectangle (0, 0, len + 5, 5), f.Frame);
 
         var r = new Ruler ();
         Assert.Equal (Orientation.Horizontal, r.Orientation);
@@ -168,7 +168,7 @@ public class RulerTests
         Application.Top.Add (f);
         Application.Begin (Application.Top);
         ((FakeDriver)Application.Driver).SetBufferSize (5, len + 5);
-        Assert.Equal (new Rect (0, 0, 5, len + 5), f.Frame);
+        Assert.Equal (new Rectangle (0, 0, 5, len + 5), f.Frame);
 
         var r = new Ruler ();
         r.Orientation = Orientation.Vertical;
@@ -300,7 +300,7 @@ public class RulerTests
         Application.Top.Add (f);
         Application.Begin (Application.Top);
         ((FakeDriver)Application.Driver).SetBufferSize (5, len + 5);
-        Assert.Equal (new Rect (0, 0, 5, len + 5), f.Frame);
+        Assert.Equal (new Rectangle (0, 0, 5, len + 5), f.Frame);
 
         var r = new Ruler ();
         r.Orientation = Orientation.Vertical;

+ 1 - 1
UnitTests/Drawing/StraightLineTests.cs

@@ -322,6 +322,6 @@ public class StraightLineTests
     {
         var sl = new StraightLine (new Point (x, y), length, orientation, LineStyle.Single);
 
-        Assert.Equal (new Rect (expectedX, expectedY, expectedWidth, expectedHeight), sl.Bounds);
+        Assert.Equal (new Rectangle (expectedX, expectedY, expectedWidth, expectedHeight), sl.Bounds);
     }
 }

+ 48 - 48
UnitTests/Drawing/ThicknessTests.cs

@@ -60,11 +60,11 @@ public class ThicknessTests
     {
         ((FakeDriver)Application.Driver).SetBufferSize (60, 60);
         var t = new Thickness (0, 0, 0, 0);
-        var r = new Rect (5, 5, 40, 15);
+        var r = new Rectangle (5, 5, 40, 15);
         ConsoleDriver.Diagnostics |= ConsoleDriver.DiagnosticFlags.FramePadding;
 
         Application.Driver.FillRect (
-                                     new Rect (0, 0, Application.Driver.Cols, Application.Driver.Rows),
+                                     new Rectangle (0, 0, Application.Driver.Cols, Application.Driver.Rows),
                                      (Rune)' '
                                     );
         t.Draw (r, "Test");
@@ -77,11 +77,11 @@ public class ThicknessTests
                                                      );
 
         t = new Thickness (1, 1, 1, 1);
-        r = new Rect (5, 5, 40, 15);
+        r = new Rectangle (5, 5, 40, 15);
         ConsoleDriver.Diagnostics |= ConsoleDriver.DiagnosticFlags.FramePadding;
 
         Application.Driver.FillRect (
-                                     new Rect (0, 0, Application.Driver.Cols, Application.Driver.Rows),
+                                     new Rectangle (0, 0, Application.Driver.Cols, Application.Driver.Rows),
                                      (Rune)' '
                                     );
         t.Draw (r, "Test");
@@ -108,11 +108,11 @@ public class ThicknessTests
                                                      );
 
         t = new Thickness (1, 2, 3, 4);
-        r = new Rect (5, 5, 40, 15);
+        r = new Rectangle (5, 5, 40, 15);
         ConsoleDriver.Diagnostics |= ConsoleDriver.DiagnosticFlags.FramePadding;
 
         Application.Driver.FillRect (
-                                     new Rect (0, 0, Application.Driver.Cols, Application.Driver.Rows),
+                                     new Rectangle (0, 0, Application.Driver.Cols, Application.Driver.Rows),
                                      (Rune)' '
                                     );
         t.Draw (r, "Test");
@@ -139,11 +139,11 @@ public class ThicknessTests
                                                      );
 
         t = new Thickness (-1, 1, 1, 1);
-        r = new Rect (5, 5, 40, 15);
+        r = new Rectangle (5, 5, 40, 15);
         ConsoleDriver.Diagnostics |= ConsoleDriver.DiagnosticFlags.FramePadding;
 
         Application.Driver.FillRect (
-                                     new Rect (0, 0, Application.Driver.Cols, Application.Driver.Rows),
+                                     new Rectangle (0, 0, Application.Driver.Cols, Application.Driver.Rows),
                                      (Rune)' '
                                     );
         t.Draw (r, "Test");
@@ -182,7 +182,7 @@ public class ThicknessTests
 
         ((FakeDriver)Application.Driver).SetBufferSize (45, 20);
         var t = new Thickness (0, 0, 0, 0);
-        var r = new Rect (2, 2, 40, 15);
+        var r = new Rectangle (2, 2, 40, 15);
         Application.Refresh ();
         ConsoleDriver.Diagnostics |= ConsoleDriver.DiagnosticFlags.FrameRuler;
         t.Draw (r, "Test");
@@ -214,7 +214,7 @@ public class ThicknessTests
                                             );
 
         t = new Thickness (1, 1, 1, 1);
-        r = new Rect (1, 1, 40, 15);
+        r = new Rectangle (1, 1, 40, 15);
         Application.Refresh ();
         ConsoleDriver.Diagnostics |= ConsoleDriver.DiagnosticFlags.FrameRuler;
         t.Draw (r, "Test");
@@ -246,7 +246,7 @@ public class ThicknessTests
                                             );
 
         t = new Thickness (1, 2, 3, 4);
-        r = new Rect (2, 2, 40, 15);
+        r = new Rectangle (2, 2, 40, 15);
         Application.Refresh ();
         ConsoleDriver.Diagnostics |= ConsoleDriver.DiagnosticFlags.FrameRuler;
         t.Draw (r, "Test");
@@ -278,7 +278,7 @@ public class ThicknessTests
                                                      );
 
         t = new Thickness (-1, 1, 1, 1);
-        r = new Rect (5, 5, 40, 15);
+        r = new Rectangle (5, 5, 40, 15);
         Application.Refresh ();
         ConsoleDriver.Diagnostics |= ConsoleDriver.DiagnosticFlags.FrameRuler;
         t.Draw (r, "Test");
@@ -344,15 +344,15 @@ public class ThicknessTests
     public void GetInsideTests_Mixed_Pos_Neg_Thickness_Non_Empty_Size ()
     {
         var t = new Thickness (-1, 1, -1, 1);
-        var r = new Rect (0, 0, 3, 3);
-        Rect inside = t.GetInside (r);
+        var r = new Rectangle (0, 0, 3, 3);
+        Rectangle inside = t.GetInside (r);
         Assert.Equal (-1, inside.X);
         Assert.Equal (1, inside.Y);
         Assert.Equal (5, inside.Width);
         Assert.Equal (1, inside.Height);
 
         t = new Thickness (-1, 1, -1, 1);
-        r = new Rect (-1, -1, 3, 3);
+        r = new Rectangle (-1, -1, 3, 3);
         inside = t.GetInside (r);
         Assert.Equal (-2, inside.X);
         Assert.Equal (0, inside.Y);
@@ -360,7 +360,7 @@ public class ThicknessTests
         Assert.Equal (1, inside.Height);
 
         t = new Thickness (-1, 1, -1, 1);
-        r = new Rect (1, 1, 3, 3);
+        r = new Rectangle (1, 1, 3, 3);
         inside = t.GetInside (r);
         Assert.Equal (0, inside.X);
         Assert.Equal (2, inside.Y);
@@ -368,7 +368,7 @@ public class ThicknessTests
         Assert.Equal (1, inside.Height);
 
         t = new Thickness (-2, -1, 0, 1);
-        r = new Rect (-1, 0, 50, 60);
+        r = new Rectangle (-1, 0, 50, 60);
         inside = t.GetInside (r);
         Assert.Equal (-3, inside.X);
         Assert.Equal (-1, inside.Y);
@@ -380,15 +380,15 @@ public class ThicknessTests
     public void GetInsideTests_Negative_Thickness_Non_Empty_Size ()
     {
         var t = new Thickness (-1, -1, -1, -1);
-        var r = new Rect (0, 0, 3, 3);
-        Rect inside = t.GetInside (r);
+        var r = new Rectangle (0, 0, 3, 3);
+        Rectangle inside = t.GetInside (r);
         Assert.Equal (-1, inside.X);
         Assert.Equal (-1, inside.Y);
         Assert.Equal (5, inside.Width);
         Assert.Equal (5, inside.Height);
 
         t = new Thickness (-1, -1, -1, -1);
-        r = new Rect (-1, -1, 3, 3);
+        r = new Rectangle (-1, -1, 3, 3);
         inside = t.GetInside (r);
         Assert.Equal (-2, inside.X);
         Assert.Equal (-2, inside.Y);
@@ -396,7 +396,7 @@ public class ThicknessTests
         Assert.Equal (5, inside.Height);
 
         t = new Thickness (-1, -1, -1, -1);
-        r = new Rect (1, 1, 3, 3);
+        r = new Rectangle (1, 1, 3, 3);
         inside = t.GetInside (r);
         Assert.Equal (0, inside.X);
         Assert.Equal (0, inside.Y);
@@ -404,7 +404,7 @@ public class ThicknessTests
         Assert.Equal (5, inside.Height);
 
         t = new Thickness (-1, -2, -3, -4);
-        r = new Rect (-1, 0, 50, 60);
+        r = new Rectangle (-1, 0, 50, 60);
         inside = t.GetInside (r);
         Assert.Equal (-2, inside.X);
         Assert.Equal (-2, inside.Y);
@@ -416,15 +416,15 @@ public class ThicknessTests
     public void GetInsideTests_Positive_Thickness_Non_Empty_Size ()
     {
         var t = new Thickness (1, 1, 1, 1);
-        var r = new Rect (0, 0, 3, 3);
-        Rect inside = t.GetInside (r);
+        var r = new Rectangle (0, 0, 3, 3);
+        Rectangle inside = t.GetInside (r);
         Assert.Equal (1, inside.X);
         Assert.Equal (1, inside.Y);
         Assert.Equal (1, inside.Width);
         Assert.Equal (1, inside.Height);
 
         t = new Thickness (1, 1, 1, 1);
-        r = new Rect (-1, -1, 3, 3);
+        r = new Rectangle (-1, -1, 3, 3);
         inside = t.GetInside (r);
         Assert.Equal (0, inside.X);
         Assert.Equal (0, inside.Y);
@@ -432,7 +432,7 @@ public class ThicknessTests
         Assert.Equal (1, inside.Height);
 
         t = new Thickness (1, 1, 1, 1);
-        r = new Rect (1, 1, 3, 3);
+        r = new Rectangle (1, 1, 3, 3);
         inside = t.GetInside (r);
         Assert.Equal (2, inside.X);
         Assert.Equal (2, inside.Y);
@@ -440,7 +440,7 @@ public class ThicknessTests
         Assert.Equal (1, inside.Height);
 
         t = new Thickness (1, 2, 3, 4);
-        r = new Rect (-1, 0, 50, 60);
+        r = new Rectangle (-1, 0, 50, 60);
         inside = t.GetInside (r);
         Assert.Equal (0, inside.X);
         Assert.Equal (2, inside.Y);
@@ -452,15 +452,15 @@ public class ThicknessTests
     public void GetInsideTests_Positive_Thickness_Too_Small_Rect_Means_Empty_Size ()
     {
         var t = new Thickness (1, 1, 1, 1);
-        var r = Rect.Empty;
-        Rect inside = t.GetInside (r);
+        var r = Rectangle.Empty;
+        Rectangle inside = t.GetInside (r);
         Assert.Equal (1, inside.X);
         Assert.Equal (1, inside.Y);
         Assert.Equal (0, inside.Width);
         Assert.Equal (0, inside.Height);
 
         t = new Thickness (1, 1, 1, 1);
-        r = new Rect (0, 0, 1, 1);
+        r = new Rectangle (0, 0, 1, 1);
         inside = t.GetInside (r);
         Assert.Equal (1, inside.X);
         Assert.Equal (1, inside.Y);
@@ -468,7 +468,7 @@ public class ThicknessTests
         Assert.Equal (0, inside.Height);
 
         t = new Thickness (1, 1, 1, 1);
-        r = new Rect (1, 1, 1, 1);
+        r = new Rectangle (1, 1, 1, 1);
         inside = t.GetInside (r);
         Assert.Equal (2, inside.X);
         Assert.Equal (2, inside.Y);
@@ -476,7 +476,7 @@ public class ThicknessTests
         Assert.Equal (0, inside.Height);
 
         t = new Thickness (1, 1, 1, 1);
-        r = new Rect (0, 0, 1, 0);
+        r = new Rectangle (0, 0, 1, 0);
         inside = t.GetInside (r);
         Assert.Equal (1, inside.X);
         Assert.Equal (1, inside.Y);
@@ -484,7 +484,7 @@ public class ThicknessTests
         Assert.Equal (0, inside.Height);
 
         t = new Thickness (1, 1, 1, 1);
-        r = new Rect (0, 0, 0, 1);
+        r = new Rectangle (0, 0, 0, 1);
         inside = t.GetInside (r);
         Assert.Equal (1, inside.X);
         Assert.Equal (1, inside.Y);
@@ -492,7 +492,7 @@ public class ThicknessTests
         Assert.Equal (0, inside.Height);
 
         t = new Thickness (1, 1, 1, 1);
-        r = new Rect (-1, -1, 0, 1);
+        r = new Rectangle (-1, -1, 0, 1);
         inside = t.GetInside (r);
         Assert.Equal (0, inside.X);
         Assert.Equal (0, inside.Y);
@@ -500,7 +500,7 @@ public class ThicknessTests
         Assert.Equal (0, inside.Height);
 
         t = new Thickness (1, 1, 1, 1);
-        r = new Rect (0, 0, 2, 2);
+        r = new Rectangle (0, 0, 2, 2);
         inside = t.GetInside (r);
         Assert.Equal (1, inside.X);
         Assert.Equal (1, inside.Y);
@@ -508,7 +508,7 @@ public class ThicknessTests
         Assert.Equal (0, inside.Height);
 
         t = new Thickness (1, 1, 1, 1);
-        r = new Rect (-1, -1, 2, 2);
+        r = new Rectangle (-1, -1, 2, 2);
         inside = t.GetInside (r);
         Assert.Equal (0, inside.X);
         Assert.Equal (0, inside.Y);
@@ -516,7 +516,7 @@ public class ThicknessTests
         Assert.Equal (0, inside.Height);
 
         t = new Thickness (1, 1, 1, 1);
-        r = new Rect (1, 1, 2, 2);
+        r = new Rectangle (1, 1, 2, 2);
         inside = t.GetInside (r);
         Assert.Equal (2, inside.X);
         Assert.Equal (2, inside.Y);
@@ -524,7 +524,7 @@ public class ThicknessTests
         Assert.Equal (0, inside.Height);
 
         t = new Thickness (1, 2, 3, 4);
-        r = new Rect (-1, 0, 4, 6);
+        r = new Rectangle (-1, 0, 4, 6);
         inside = t.GetInside (r);
         Assert.Equal (0, inside.X);
         Assert.Equal (2, inside.Y);
@@ -536,15 +536,15 @@ public class ThicknessTests
     public void GetInsideTests_Zero_Thickness ()
     {
         var t = new Thickness (0, 0, 0, 0);
-        var r = Rect.Empty;
-        Rect inside = t.GetInside (r);
+        var r = Rectangle.Empty;
+        Rectangle inside = t.GetInside (r);
         Assert.Equal (0, inside.X);
         Assert.Equal (0, inside.Y);
         Assert.Equal (0, inside.Width);
         Assert.Equal (0, inside.Height);
 
         t = new Thickness (0, 0, 0, 0);
-        r = new Rect (0, 0, 1, 1);
+        r = new Rectangle (0, 0, 1, 1);
         inside = t.GetInside (r);
         Assert.Equal (0, inside.X);
         Assert.Equal (0, inside.Y);
@@ -552,7 +552,7 @@ public class ThicknessTests
         Assert.Equal (1, inside.Height);
 
         t = new Thickness (0, 0, 0, 0);
-        r = new Rect (1, 1, 1, 1);
+        r = new Rectangle (1, 1, 1, 1);
         inside = t.GetInside (r);
         Assert.Equal (1, inside.X);
         Assert.Equal (1, inside.Y);
@@ -560,7 +560,7 @@ public class ThicknessTests
         Assert.Equal (1, inside.Height);
 
         t = new Thickness (0, 0, 0, 0);
-        r = new Rect (0, 0, 1, 0);
+        r = new Rectangle (0, 0, 1, 0);
         inside = t.GetInside (r);
         Assert.Equal (0, inside.X);
         Assert.Equal (0, inside.Y);
@@ -568,7 +568,7 @@ public class ThicknessTests
         Assert.Equal (0, inside.Height);
 
         t = new Thickness (0, 0, 0, 0);
-        r = new Rect (0, 0, 0, 1);
+        r = new Rectangle (0, 0, 0, 1);
         inside = t.GetInside (r);
         Assert.Equal (0, inside.X);
         Assert.Equal (0, inside.Y);
@@ -576,7 +576,7 @@ public class ThicknessTests
         Assert.Equal (1, inside.Height);
 
         t = new Thickness (0, 0, 0, 0);
-        r = new Rect (-1, -1, 0, 1);
+        r = new Rectangle (-1, -1, 0, 1);
         inside = t.GetInside (r);
         Assert.Equal (-1, inside.X);
         Assert.Equal (-1, inside.Y);
@@ -644,7 +644,7 @@ public class ThicknessTests
     [InlineData (-1, -1, 10, 10, -2, -2, false)] // Outside the outer rectangle
     public void TestContains_Uniform1 (int x, int y, int width, int height, int pointX, int pointY, bool expected)
     {
-        var rect = new Rect (x, y, width, height);
+        var rect = new Rectangle (x, y, width, height);
         var thickness = new Thickness (1, 1, 1, 1); // Uniform thickness for simplicity
         bool result = thickness.Contains (rect, pointX, pointY);
         Assert.Equal (expected, result);
@@ -683,7 +683,7 @@ public class ThicknessTests
     [InlineData (-1, -1, 4, 4, 3, 3, false)] // outside outer rect
     public void TestContains_Uniform2 (int x, int y, int width, int height, int pointX, int pointY, bool expected)
     {
-        var rect = new Rect (x, y, width, height);
+        var rect = new Rectangle (x, y, width, height);
         var thickness = new Thickness (2, 2, 2, 2); // Uniform thickness for simplicity
         bool result = thickness.Contains (rect, pointX, pointY);
         Assert.Equal (expected, result);
@@ -718,7 +718,7 @@ public class ThicknessTests
         bool expected
     )
     {
-        var rect = new Rect (x, y, width, height);
+        var rect = new Rectangle (x, y, width, height);
         var thickness = new Thickness (0, 0, 0, 0); // Uniform thickness for simplicity
         bool result = thickness.Contains (rect, pointX, pointY);
         Assert.Equal (expected, result);

+ 29 - 29
UnitTests/TestHelpers.cs

@@ -173,6 +173,8 @@ public class TestDateAttribute : BeforeAfterTestAttribute
 
 internal partial class TestHelpers
 {
+    private const char SpaceChar = ' ';
+    private static readonly Rune SpaceRune = (Rune)SpaceChar;
 #pragma warning disable xUnit1013 // Public method should be marked as test
     /// <summary>
     ///     Verifies <paramref name="expectedAttributes"/> are found at the locations specified by
@@ -312,7 +314,7 @@ internal partial class TestHelpers
     /// <param name="output"></param>
     /// <param name="driver">The ConsoleDriver to use. If null <see cref="Application.Driver"/> will be used.</param>
     /// <returns></returns>
-    public static Rect AssertDriverContentsWithFrameAre (
+    public static Rectangle AssertDriverContentsWithFrameAre (
         string expectedLook,
         ITestOutputHelper output,
         ConsoleDriver driver = null
@@ -328,43 +330,44 @@ internal partial class TestHelpers
 
         Cell [,] contents = driver.Contents;
 
-        for (var r = 0; r < driver.Rows; r++)
+
+        for (var rowIndex = 0; rowIndex < driver.Rows; rowIndex++)
         {
-            List<Rune> runes = new ();
+            List<Rune> runes = [];
 
-            for (var c = 0; c < driver.Cols; c++)
+            for (var colIndex = 0; colIndex < driver.Cols; colIndex++)
             {
-                Rune rune = contents [r, c].Rune;
+                Rune runeAtCurrentLocation = contents [rowIndex, colIndex].Rune;
 
-                if (rune != (Rune)' ')
+                if (runeAtCurrentLocation != SpaceRune)
                 {
                     if (x == -1)
                     {
-                        x = c;
-                        y = r;
+                        x = colIndex;
+                        y = rowIndex;
 
-                        for (var i = 0; i < c; i++)
+                        for (int i = 0; i < colIndex; i++)
                         {
-                            runes.InsertRange (i, new List<Rune> { (Rune)' ' });
+                            runes.InsertRange (i, [SpaceRune]);
                         }
                     }
 
-                    if (rune.GetColumns () > 1)
+                    if (runeAtCurrentLocation.GetColumns () > 1)
                     {
-                        c++;
+                        colIndex++;
                     }
 
-                    if (c + 1 > w)
+                    if (colIndex + 1 > w)
                     {
-                        w = c + 1;
+                        w = colIndex + 1;
                     }
 
-                    h = r - y + 1;
+                    h = rowIndex - y + 1;
                 }
 
                 if (x > -1)
                 {
-                    runes.Add (rune);
+                    runes.Add (runeAtCurrentLocation);
                 }
 
                 // See Issue #2616
@@ -423,30 +426,27 @@ internal partial class TestHelpers
 
         if (string.Equals (expectedLook, actualLook))
         {
-            return new Rect (x > -1 ? x : 0, y > -1 ? y : 0, w > -1 ? w : 0, h > -1 ? h : 0);
+            return new Rectangle (x > -1 ? x : 0, y > -1 ? y : 0, w > -1 ? w : 0, h > -1 ? h : 0);
         }
 
         // standardize line endings for the comparison
-        expectedLook = expectedLook.Replace ("\r\n", "\n");
-        actualLook = actualLook.Replace ("\r\n", "\n");
+        expectedLook = expectedLook.ReplaceLineEndings ();
+        actualLook = actualLook.ReplaceLineEndings();
 
         // Remove the first and the last line ending from the expectedLook
-        if (expectedLook.StartsWith ("\n"))
+        if (expectedLook.StartsWith (Environment.NewLine))
         {
-            expectedLook = expectedLook [1..];
+            expectedLook = expectedLook [Environment.NewLine.Length..];
         }
 
-        if (expectedLook.EndsWith ("\n"))
+        if (expectedLook.EndsWith (Environment.NewLine))
         {
-            expectedLook = expectedLook [..^1];
+            expectedLook = expectedLook [..^Environment.NewLine.Length];
         }
 
-        output?.WriteLine ("Expected:" + Environment.NewLine + expectedLook);
-        output?.WriteLine (" But Was:" + Environment.NewLine + actualLook);
-
         Assert.Equal (expectedLook, actualLook);
 
-        return new Rect (x > -1 ? x : 0, y > -1 ? y : 0, w > -1 ? w : 0, h > -1 ? h : 0);
+        return new Rectangle (x > -1 ? x : 0, y > -1 ? y : 0, w > -1 ? w : 0, h > -1 ? h : 0);
     }
 
 #pragma warning disable xUnit1013 // Public method should be marked as test
@@ -582,9 +582,9 @@ internal partial class TestHelpers
 
     private static void AddArguments (Type paramType, List<object> pTypes)
     {
-        if (paramType == typeof (Rect))
+        if (paramType == typeof (Rectangle))
         {
-            pTypes.Add (Rect.Empty);
+            pTypes.Add (Rectangle.Empty);
         }
         else if (paramType == typeof (string))
         {

+ 21 - 21
UnitTests/Text/TextFormatterTests.cs

@@ -44,7 +44,7 @@ public class TextFormatterTests
     {
         var testText = "test";
         var expectedSize = new Size ();
-        var testBounds = new Rect (0, 0, 100, 1);
+        var testBounds = new Rectangle (0, 0, 100, 1);
         var tf = new TextFormatter ();
 
         tf.Text = testText;
@@ -91,9 +91,9 @@ public class TextFormatterTests
     [InlineData ("")]
     public void CalcRect_Invalid_Returns_Empty (string text)
     {
-        Assert.Equal (Rect.Empty, TextFormatter.CalcRect (0, 0, text));
-        Assert.Equal (new Rect (new Point (1, 2), Size.Empty), TextFormatter.CalcRect (1, 2, text));
-        Assert.Equal (new Rect (new Point (-1, -2), Size.Empty), TextFormatter.CalcRect (-1, -2, text));
+        Assert.Equal (Rectangle.Empty, TextFormatter.CalcRect (0, 0, text));
+        Assert.Equal (new Rectangle (new Point (1, 2), Size.Empty), TextFormatter.CalcRect (1, 2, text));
+        Assert.Equal (new Rectangle (new Point (-1, -2), Size.Empty), TextFormatter.CalcRect (-1, -2, text));
     }
 
     [Theory]
@@ -109,7 +109,7 @@ public class TextFormatterTests
     [InlineData (" ~  s  gui.cs   master\n↑10", 27, 2)]
     public void CalcRect_MultiLine_Returns_nHigh (string text, int expectedWidth, int expectedLines)
     {
-        Assert.Equal (new Rect (0, 0, expectedWidth, expectedLines), TextFormatter.CalcRect (0, 0, text));
+        Assert.Equal (new Rectangle (0, 0, expectedWidth, expectedLines), TextFormatter.CalcRect (0, 0, text));
         string [] lines = text.Split (text.Contains (Environment.NewLine) ? Environment.NewLine : "\n");
         int maxWidth = lines.Max (s => s.GetColumns ());
         var lineWider = 0;
@@ -124,10 +124,10 @@ public class TextFormatterTests
             }
         }
 
-        Assert.Equal (new Rect (0, 0, maxWidth, expectedLines), TextFormatter.CalcRect (0, 0, text));
+        Assert.Equal (new Rectangle (0, 0, maxWidth, expectedLines), TextFormatter.CalcRect (0, 0, text));
 
         Assert.Equal (
-                      new Rect (
+                      new Rectangle (
                                 0,
                                 0,
                                 lines [lineWider].ToRuneList ().Sum (r => Math.Max (r.GetColumns (), 0)),
@@ -142,8 +142,8 @@ public class TextFormatterTests
     [InlineData (" ~  s  gui.cs   master ↑10")]
     public void CalcRect_SingleLine_Returns_1High (string text)
     {
-        Assert.Equal (new Rect (0, 0, text.GetRuneCount (), 1), TextFormatter.CalcRect (0, 0, text));
-        Assert.Equal (new Rect (0, 0, text.GetColumns (), 1), TextFormatter.CalcRect (0, 0, text));
+        Assert.Equal (new Rectangle (0, 0, text.GetRuneCount (), 1), TextFormatter.CalcRect (0, 0, text));
+        Assert.Equal (new Rectangle (0, 0, text.GetColumns (), 1), TextFormatter.CalcRect (0, 0, text));
     }
 
     [Theory]
@@ -152,7 +152,7 @@ public class TextFormatterTests
     public void CalcRect_With_Combining_Runes (int width, int height, TextDirection textDirection)
     {
         var text = "Les Mise\u0328\u0301rables";
-        Assert.Equal (new Rect (0, 0, width, height), TextFormatter.CalcRect (0, 0, text, textDirection));
+        Assert.Equal (new Rectangle (0, 0, width, height), TextFormatter.CalcRect (0, 0, text, textDirection));
     }
 
     [Theory]
@@ -415,10 +415,10 @@ ssb
         }
 
         tf.Draw (
-                 new Rect (0, 0, width, height),
+                 new Rectangle (0, 0, width, height),
                  new Attribute (ColorName.White, ColorName.Black),
                  new Attribute (ColorName.Blue, ColorName.Black),
-                 default (Rect),
+                 default (Rectangle),
                  driver
                 );
         TestHelpers.AssertDriverContentsWithFrameAre (expected, _output, driver);
@@ -440,7 +440,7 @@ ssb
         var tf = new TextFormatter { Size = new Size (14, 3), Text = "Test\nTest long\nTest long long\n", MultiLine = true };
 
         tf.Draw (
-                 new Rect (1, 1, 19, 3),
+                 new Rectangle (1, 1, 19, 3),
                  attrs [1],
                  attrs [2]);
 
@@ -466,7 +466,7 @@ ssb
         tf.FillRemaining = true;
 
         tf.Draw (
-                 new Rect (1, 1, 19, 3),
+                 new Rectangle (1, 1, 19, 3),
                  attrs [1],
                  attrs [2]);
 
@@ -1286,7 +1286,7 @@ ssb
     public void NeedsFormat_Sets ()
     {
         var testText = "test";
-        var testBounds = new Rect (0, 0, 100, 1);
+        var testBounds = new Rectangle (0, 0, 100, 1);
         var tf = new TextFormatter ();
 
         tf.Text = "test";
@@ -2060,10 +2060,10 @@ ssb
         Assert.Equal (new Size (width, height), tf.Size);
 
         tf.Draw (
-                 new Rect (0, 0, width, height),
+                 new Rectangle (0, 0, width, height),
                  new Attribute (ColorName.White, ColorName.Black),
                  new Attribute (ColorName.Blue, ColorName.Black),
-                 default (Rect),
+                 default (Rectangle),
                  driver
                 );
         TestHelpers.AssertDriverContentsWithFrameAre (expected, _output, driver);
@@ -2098,10 +2098,10 @@ ssb
         Assert.Equal (new Size (width, height), tf.Size);
 
         tf.Draw (
-                 new Rect (0, 0, width, height),
+                 new Rectangle (0, 0, width, height),
                  new Attribute (ColorName.White, ColorName.Black),
                  new Attribute (ColorName.Blue, ColorName.Black),
-                 default (Rect),
+                 default (Rectangle),
                  driver
                 );
         TestHelpers.AssertDriverContentsWithFrameAre (expected, _output, driver);
@@ -2136,10 +2136,10 @@ ssb
         Assert.Equal (new Size (width, height), tf.Size);
 
         tf.Draw (
-                 new Rect (0, 0, width, height),
+                 new Rectangle (0, 0, width, height),
                  new Attribute (ColorName.White, ColorName.Black),
                  new Attribute (ColorName.Blue, ColorName.Black),
-                 default (Rect),
+                 default (Rectangle),
                  driver
                 );
         TestHelpers.AssertDriverContentsWithFrameAre (expected, _output, driver);

+ 89 - 80
UnitTests/Types/RectTests.cs → UnitTests/Types/RectangleTests.cs

@@ -1,6 +1,6 @@
 namespace Terminal.Gui.TypeTests;
 
-public class RectTests
+public class RectangleTests
 {
     [Theory]
 
@@ -178,7 +178,7 @@ public class RectTests
         int expectedHeight
     )
     {
-        var rect = new Rect (x, y, width, height);
+        var rect = new Rectangle (x, y, width, height);
 
         if (rect.Width + inflateWidth < 0 || rect.Height + inflateHeight < 0)
         {
@@ -195,7 +195,7 @@ public class RectTests
         Assert.Equal (exptectedY, rect.Y);
 
         // Use the other overload (Size)
-        rect = new Rect (x, y, width, height);
+        rect = new Rectangle (x, y, width, height);
 
         if (rect.Width + inflateWidth < 0 || rect.Height + inflateHeight < 0)
         {
@@ -215,7 +215,7 @@ public class RectTests
     [Fact]
     public void Negative_X_Y_Positions ()
     {
-        var rect = new Rect (-10, -5, 100, 50);
+        var rect = new Rectangle (-10, -5, 100, 50);
         int yCount = 0, xCount = 0, yxCount = 0;
 
         for (int line = rect.Y; line < rect.Y + rect.Height; line++)
@@ -238,7 +238,7 @@ public class RectTests
     [Fact]
     public void Positive_X_Y_Positions ()
     {
-        var rect = new Rect (10, 5, 100, 50);
+        var rect = new Rectangle (10, 5, 100, 50);
         int yCount = 0, xCount = 0, yxCount = 0;
 
         for (int line = rect.Y; line < rect.Y + rect.Height; line++)
@@ -261,7 +261,7 @@ public class RectTests
     [Fact]
     public void Rect_Contains ()
     {
-        var rect = new Rect (0, 0, 3, 3);
+        var rect = new Rectangle (0, 0, 3, 3);
         Assert.True (rect.Contains (new Point (1, 1)));
         Assert.True (rect.Contains (new Point (1, 2)));
         Assert.True (rect.Contains (new Point (2, 1)));
@@ -273,17 +273,17 @@ public class RectTests
         Assert.False (rect.Contains (new Point (2, 3)));
         Assert.False (rect.Contains (new Point (3, 3)));
 
-        Assert.True (rect.Contains (new Rect (1, 1, 2, 2)));
-        Assert.True (rect.Contains (new Rect (1, 2, 2, 1)));
-        Assert.True (rect.Contains (new Rect (2, 1, 1, 2)));
-        Assert.True (rect.Contains (new Rect (2, 2, 1, 1)));
-        Assert.True (rect.Contains (new Rect (0, 0, 3, 3)));
+        Assert.True (rect.Contains (new Rectangle (1, 1, 2, 2)));
+        Assert.True (rect.Contains (new Rectangle (1, 2, 2, 1)));
+        Assert.True (rect.Contains (new Rectangle (2, 1, 1, 2)));
+        Assert.True (rect.Contains (new Rectangle (2, 2, 1, 1)));
+        Assert.True (rect.Contains (new Rectangle (0, 0, 3, 3)));
 
-        Assert.False (rect.Contains (new Rect (-1, 1, 3, 3)));
-        Assert.False (rect.Contains (new Rect (1, -1, 3, 3)));
-        Assert.False (rect.Contains (new Rect (3, 2, 3, 3)));
-        Assert.False (rect.Contains (new Rect (2, 3, 3, 3)));
-        Assert.False (rect.Contains (new Rect (3, 3, 3, 3)));
+        Assert.False (rect.Contains (new Rectangle (-1, 1, 3, 3)));
+        Assert.False (rect.Contains (new Rectangle (1, -1, 3, 3)));
+        Assert.False (rect.Contains (new Rectangle (3, 2, 3, 3)));
+        Assert.False (rect.Contains (new Rectangle (2, 3, 3, 3)));
+        Assert.False (rect.Contains (new Rectangle (3, 3, 3, 3)));
 
         Assert.True (rect.Contains (1, 1));
         Assert.True (rect.Contains (1, 2));
@@ -300,43 +300,43 @@ public class RectTests
     [Fact]
     public void Rect_Equals ()
     {
-        var rect1 = new Rect ();
-        var rect2 = new Rect ();
+        var rect1 = new Rectangle ();
+        var rect2 = new Rectangle ();
         Assert.Equal (rect1, rect2);
 
-        rect1 = new Rect (1, 2, 3, 4);
-        rect2 = new Rect (1, 2, 3, 4);
+        rect1 = new Rectangle (1, 2, 3, 4);
+        rect2 = new Rectangle (1, 2, 3, 4);
         Assert.Equal (rect1, rect2);
 
-        rect1 = new Rect (1, 2, 3, 4);
-        rect2 = new Rect (-1, 2, 3, 4);
+        rect1 = new Rectangle (1, 2, 3, 4);
+        rect2 = new Rectangle (-1, 2, 3, 4);
         Assert.NotEqual (rect1, rect2);
     }
 
     [Fact]
     public void Rect_New ()
     {
-        var rect = new Rect ();
+        var rect = new Rectangle ();
         Assert.True (rect.IsEmpty);
 
-        rect = new Rect (new Point (), new Size ());
+        rect = new Rectangle (new Point (), new Size ());
         Assert.True (rect.IsEmpty);
 
-        rect = new Rect (1, 2, 3, 4);
+        rect = new Rectangle (1, 2, 3, 4);
         Assert.False (rect.IsEmpty);
 
-        rect = new Rect (-1, -2, 3, 4);
+        rect = new Rectangle (-1, -2, 3, 4);
         Assert.False (rect.IsEmpty);
 
-        Action action = () => new Rect (1, 2, -3, 4);
+        Action action = () => new Rectangle (1, 2, -3, 4);
         var ex = Assert.Throws<ArgumentException> (action);
         Assert.Equal ("Width must be greater or equal to 0.", ex.Message);
 
-        action = () => new Rect (1, 2, 3, -4);
+        action = () => new Rectangle (1, 2, 3, -4);
         ex = Assert.Throws<ArgumentException> (action);
         Assert.Equal ("Height must be greater or equal to 0.", ex.Message);
 
-        action = () => new Rect (1, 2, -3, -4);
+        action = () => new Rectangle (1, 2, -3, -4);
         ex = Assert.Throws<ArgumentException> (action);
         Assert.Equal ("Width must be greater or equal to 0.", ex.Message);
     }
@@ -344,27 +344,27 @@ public class RectTests
     [Fact]
     public void Rect_SetsValue ()
     {
-        var rect = new Rect { X = 0, Y = 0 };
+        var rect = new Rectangle { X = 0, Y = 0 };
         Assert.True (rect.IsEmpty);
 
-        rect = new Rect { X = -1, Y = -2 };
+        rect = new Rectangle { X = -1, Y = -2 };
         Assert.False (rect.IsEmpty);
 
-        rect = new Rect { Width = 3, Height = 4 };
+        rect = new Rectangle { Width = 3, Height = 4 };
         Assert.False (rect.IsEmpty);
 
-        rect = new Rect { X = -1, Y = -2, Width = 3, Height = 4 };
+        rect = new Rectangle { X = -1, Y = -2, Width = 3, Height = 4 };
         Assert.False (rect.IsEmpty);
 
-        Action action = () => { rect = new Rect { X = -1, Y = -2, Width = -3, Height = 4 }; };
+        Action action = () => { rect = new Rectangle { X = -1, Y = -2, Width = -3, Height = 4 }; };
         var ex = Assert.Throws<ArgumentException> (action);
         Assert.Equal ("Width must be greater or equal to 0.", ex.Message);
 
-        action = () => { rect = new Rect { X = -1, Y = -2, Width = 3, Height = -4 }; };
+        action = () => { rect = new Rectangle { X = -1, Y = -2, Width = 3, Height = -4 }; };
         ex = Assert.Throws<ArgumentException> (action);
         Assert.Equal ("Height must be greater or equal to 0.", ex.Message);
 
-        action = () => { rect = new Rect { X = -1, Y = -2, Width = -3, Height = -4 }; };
+        action = () => { rect = new Rectangle { X = -1, Y = -2, Width = -3, Height = -4 }; };
         ex = Assert.Throws<ArgumentException> (action);
         Assert.Equal ("Width must be greater or equal to 0.", ex.Message);
     }
@@ -372,139 +372,148 @@ public class RectTests
     [Fact]
     public void Union_EmptyRectangles ()
     {
-        var r1 = new Rect (0, 0, 0, 0);
-        var r2 = new Rect (1, 1, 0, 0);
-        Rect result = Rect.Union (r1, r2);
-        Assert.Equal (new Rect (0, 0, 1, 1), result);
+        var r1 = new Rectangle (0, 0, 0, 0);
+        var r2 = new Rectangle (1, 1, 0, 0);
+        Rectangle result = Rectangle.Union (r1, r2);
+        Assert.Equal (new Rectangle (0, 0, 1, 1), result);
     }
 
     [Fact]
     public void Union_NegativeCoords ()
     {
         // arrange
-        var rect1 = new Rect (-2, -2, 4, 4);
-        var rect2 = new Rect (-1, -1, 5, 5);
+        var rect1 = new Rectangle (-2, -2, 4, 4);
+        var rect2 = new Rectangle (-1, -1, 5, 5);
 
         // act
-        Rect result = Rect.Union (rect1, rect2);
+        Rectangle result = Rectangle.Union (rect1, rect2);
 
         // assert
-        Assert.Equal (new Rect (-2, -2, 6, 6), result);
+        Assert.Equal (new Rectangle (-2, -2, 6, 6), result);
     }
 
     [Fact]
     public void Union_PositiveCoords ()
     {
-        var r1 = new Rect (0, 0, 2, 2);
-        var r2 = new Rect (1, 1, 2, 2);
-        Rect result = Rect.Union (r1, r2);
-        Assert.Equal (new Rect (0, 0, 3, 3), result);
+        var r1 = new Rectangle (0, 0, 2, 2);
+        var r2 = new Rectangle (1, 1, 2, 2);
+        Rectangle result = Rectangle.Union (r1, r2);
+        Assert.Equal (new Rectangle (0, 0, 3, 3), result);
     }
 
     [Fact]
     public void Union_RectangleAHasNegativeCoordinates_ReturnsCombinedRectangle ()
     {
         // arrange
-        var rect1 = new Rect (-2, -2, 5, 5);
-        var rect2 = new Rect (3, 3, 4, 4);
+        var rect1 = new Rectangle (-2, -2, 5, 5);
+        var rect2 = new Rectangle (3, 3, 4, 4);
 
         // act
-        Rect result = Rect.Union (rect1, rect2);
+        Rectangle result = Rectangle.Union (rect1, rect2);
 
         // assert
-        Assert.Equal (new Rect (-2, -2, 9, 9), result);
+        Assert.Equal (new Rectangle (-2, -2, 9, 9), result);
     }
 
     [Fact]
     public void Union_RectangleAIsLarger_ReturnsA ()
     {
         // arrange
-        var rect1 = new Rect (1, 1, 6, 6);
-        var rect2 = new Rect (2, 2, 3, 3);
+        var rect1 = new Rectangle (1, 1, 6, 6);
+        var rect2 = new Rectangle (2, 2, 3, 3);
 
         // act
-        Rect result = Rect.Union (rect1, rect2);
+        Rectangle result = Rectangle.Union (rect1, rect2);
 
         // assert
-        Assert.Equal (new Rect (1, 1, 6, 6), result);
+        Assert.Equal (new Rectangle (1, 1, 6, 6), result);
     }
 
     [Fact]
     public void Union_RectangleBIsLarger_ReturnsB ()
     {
         // arrange
-        var rect1 = new Rect (1, 1, 3, 3);
-        var rect2 = new Rect (2, 2, 6, 6);
+        var rect1 = new Rectangle (1, 1, 3, 3);
+        var rect2 = new Rectangle (2, 2, 6, 6);
 
         // act
-        Rect result = Rect.Union (rect1, rect2);
+        Rectangle result = Rectangle.Union (rect1, rect2);
 
         // assert
-        Assert.Equal (new Rect (1, 1, 7, 7), result);
+        Assert.Equal (new Rectangle (1, 1, 7, 7), result);
     }
 
     [Fact]
     public void Union_RectanglesDoNotOverlap_ReturnsCombinedRectangle ()
     {
         // arrange
-        var rect1 = new Rect (1, 1, 3, 3);
-        var rect2 = new Rect (5, 5, 3, 3);
+        var rect1 = new Rectangle (1, 1, 3, 3);
+        var rect2 = new Rectangle (5, 5, 3, 3);
 
         // act
-        Rect result = Rect.Union (rect1, rect2);
+        Rectangle result = Rectangle.Union (rect1, rect2);
 
         // assert
-        Assert.Equal (new Rect (1, 1, 7, 7), result);
+        Assert.Equal (new Rectangle (1, 1, 7, 7), result);
     }
 
     [Fact]
     public void Union_RectanglesOverlap_ReturnsCombinedRectangle ()
     {
         // arrange
-        var rect1 = new Rect (1, 1, 3, 3);
-        var rect2 = new Rect (2, 2, 3, 3);
+        var rect1 = new Rectangle (1, 1, 3, 3);
+        var rect2 = new Rectangle (2, 2, 3, 3);
 
         // act
-        Rect result = Rect.Union (rect1, rect2);
+        Rectangle result = Rectangle.Union (rect1, rect2);
 
         // assert
-        Assert.Equal (new Rect (1, 1, 4, 4), result);
+        Assert.Equal (new Rectangle (1, 1, 4, 4), result);
     }
 
     [Fact]
     public void Union_RectanglesTouchHorizontally_ReturnsCombinedRectangle ()
     {
         // arrange
-        var rect1 = new Rect (1, 1, 3, 3);
-        var rect2 = new Rect (4, 2, 3, 3);
+        var rect1 = new Rectangle (1, 1, 3, 3);
+        var rect2 = new Rectangle (4, 2, 3, 3);
 
         // act
-        Rect result = Rect.Union (rect1, rect2);
+        Rectangle result = Rectangle.Union (rect1, rect2);
 
         // assert
-        Assert.Equal (new Rect (1, 1, 6, 4), result);
+        Assert.Equal (new Rectangle (1, 1, 6, 4), result);
     }
 
     [Fact]
     public void Union_RectanglesTouchVertically_ReturnsCombinedRectangle ()
     {
         // arrange
-        var rect1 = new Rect (1, 1, 3, 3);
-        var rect2 = new Rect (2, 4, 3, 3);
+        var rect1 = new Rectangle (1, 1, 3, 3);
+        var rect2 = new Rectangle (2, 4, 3, 3);
 
         // act
-        Rect result = Rect.Union (rect1, rect2);
+        Rectangle result = Rectangle.Union (rect1, rect2);
 
         // assert
-        Assert.Equal (new Rect (1, 1, 4, 6), result);
+        Assert.Equal (new Rectangle (1, 1, 4, 6), result);
     }
 
     [Fact]
     public void Union_SameRectangle ()
     {
-        var r1 = new Rect (0, 0, 2, 2);
-        var r2 = new Rect (0, 0, 2, 2);
-        Rect result = Rect.Union (r1, r2);
-        Assert.Equal (new Rect (0, 0, 2, 2), result);
+        var r1 = new Rectangle (0, 0, 2, 2);
+        var r2 = new Rectangle (0, 0, 2, 2);
+        Rectangle result = Rectangle.Union (r1, r2);
+        Assert.Equal (new Rectangle (0, 0, 2, 2), result);
+    }
+
+    [Theory]
+    [CombinatorialData]
+    public void ToString_ReturnsExpectedString ([CombinatorialValues(-1,0,1)]int x, [CombinatorialValues(-1,0,1)]int y, [CombinatorialValues(1,10)]int width, [CombinatorialValues(1,10)]int height)
+    {
+        Rectangle r = new (x, y, width, height);
+        string expectedString = $"{{X={r.X},Y={r.Y},Width={r.Width},Height={r.Height}}}";
+        Assert.Equal (expectedString, r.ToString ());
     }
 }

+ 1 - 1
UnitTests/UnitTests.csproj

@@ -31,7 +31,7 @@
       <PrivateAssets>all</PrivateAssets>
       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
     </PackageReference>
-    <PackageReference Include="coverlet.collector" Version="6.0.0">
+    <PackageReference Include="coverlet.collector" Version="6.0.1">
       <PrivateAssets>all</PrivateAssets>
       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
     </PackageReference>

+ 16 - 16
UnitTests/View/Adornment/AdornmentTests.cs

@@ -15,14 +15,14 @@ public class AdornmentTests
         parent.BeginInit ();
         parent.EndInit ();
 
-        Assert.Equal (new Rect (1, 2, 10, 10), parent.Frame);
-        Assert.Equal (new Rect (0, 0, 10, 10), parent.Bounds);
-        Assert.Equal (new Rect (0, 0, 10, 10), parent.Margin.Frame);
-        Assert.Equal (new Rect (0, 0, 10, 10), parent.Margin.Bounds);
+        Assert.Equal (new Rectangle (1, 2, 10, 10), parent.Frame);
+        Assert.Equal (new Rectangle (0, 0, 10, 10), parent.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 10, 10), parent.Margin.Frame);
+        Assert.Equal (new Rectangle (0, 0, 10, 10), parent.Margin.Bounds);
 
         Assert.Null (parent.Margin.SuperView);
-        Rect boundsAsScreen = parent.Margin.BoundsToScreen (new Rect (1, 2, 5, 5));
-        Assert.Equal (new Rect (2, 4, 5, 5), boundsAsScreen);
+        Rectangle boundsAsScreen = parent.Margin.BoundsToScreen (new Rectangle (1, 2, 5, 5));
+        Assert.Equal (new Rectangle (2, 4, 5, 5), boundsAsScreen);
     }
 
     [Fact]
@@ -33,13 +33,13 @@ public class AdornmentTests
         parent.BeginInit ();
         parent.EndInit ();
 
-        Assert.Equal (new Rect (1, 2, 10, 10), parent.Frame);
-        Assert.Equal (new Rect (0, 0, 10, 10), parent.Bounds);
-        Assert.Equal (new Rect (0, 0, 10, 10), parent.Margin.Frame);
-        Assert.Equal (new Rect (0, 0, 10, 10), parent.Margin.Bounds);
+        Assert.Equal (new Rectangle (1, 2, 10, 10), parent.Frame);
+        Assert.Equal (new Rectangle (0, 0, 10, 10), parent.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 10, 10), parent.Margin.Frame);
+        Assert.Equal (new Rectangle (0, 0, 10, 10), parent.Margin.Bounds);
 
         Assert.Null (parent.Margin.SuperView);
-        Assert.Equal (new Rect (1, 2, 10, 10), parent.Margin.FrameToScreen ());
+        Assert.Equal (new Rectangle (1, 2, 10, 10), parent.Margin.FrameToScreen ());
     }
 
     [Fact]
@@ -72,7 +72,7 @@ public class AdornmentTests
     public void Setting_Bounds_Throws ()
     {
         var adornment = new Adornment (null);
-        Assert.Throws<InvalidOperationException> (() => adornment.Bounds = new Rect (1, 2, 3, 4));
+        Assert.Throws<InvalidOperationException> (() => adornment.Bounds = new Rectangle (1, 2, 3, 4));
     }
 
     [Fact]
@@ -96,12 +96,12 @@ public class AdornmentTests
         parent.BeginInit ();
         parent.EndInit ();
 
-        Assert.Equal (new Rect (0, 0, 10, 10), parent.Frame);
-        Assert.Equal (new Rect (0, 0, 10, 10), parent.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 10, 10), parent.Frame);
+        Assert.Equal (new Rectangle (0, 0, 10, 10), parent.Bounds);
 
         parent.Margin.Thickness = new Thickness (1);
-        Assert.Equal (new Rect (0, 0, 10, 10), parent.Frame);
-        Assert.Equal (new Rect (0, 0, 8, 8), parent.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 10, 10), parent.Frame);
+        Assert.Equal (new Rectangle (0, 0, 8, 8), parent.Bounds);
     }
 
     [Fact]

+ 34 - 34
UnitTests/View/Adornment/BorderTests.cs

@@ -99,7 +99,7 @@ public class BorderTests
         switch (width)
         {
             case 1:
-                Assert.Equal (new Rect (0, 0, 1, 5), win.Frame);
+                Assert.Equal (new Rectangle (0, 0, 1, 5), win.Frame);
 
                 expected = @"
@@ -108,7 +108,7 @@ public class BorderTests
 
                 break;
             case 2:
-                Assert.Equal (new Rect (0, 0, 2, 5), win.Frame);
+                Assert.Equal (new Rectangle (0, 0, 2, 5), win.Frame);
 
                 expected = @"
 ╔╗
@@ -117,7 +117,7 @@ public class BorderTests
 
                 break;
             case 3:
-                Assert.Equal (new Rect (0, 0, 3, 5), win.Frame);
+                Assert.Equal (new Rectangle (0, 0, 3, 5), win.Frame);
 
                 expected = @"
 ╔═╗
@@ -126,7 +126,7 @@ public class BorderTests
 
                 break;
             case 4:
-                Assert.Equal (new Rect (0, 0, 4, 5), win.Frame);
+                Assert.Equal (new Rectangle (0, 0, 4, 5), win.Frame);
 
                 expected = @"
  ╒╕ 
@@ -136,7 +136,7 @@ public class BorderTests
 
                 break;
             case 5:
-                Assert.Equal (new Rect (0, 0, 5, 5), win.Frame);
+                Assert.Equal (new Rectangle (0, 0, 5, 5), win.Frame);
 
                 expected = @"
  ╒═╕ 
@@ -146,7 +146,7 @@ public class BorderTests
 
                 break;
             case 6:
-                Assert.Equal (new Rect (0, 0, 6, 5), win.Frame);
+                Assert.Equal (new Rectangle (0, 0, 6, 5), win.Frame);
 
                 expected = @"
  ╒══╕ 
@@ -156,7 +156,7 @@ public class BorderTests
 
                 break;
             case 7:
-                Assert.Equal (new Rect (0, 0, 7, 5), win.Frame);
+                Assert.Equal (new Rectangle (0, 0, 7, 5), win.Frame);
 
                 expected = @"
  ╒═══╕ 
@@ -166,7 +166,7 @@ public class BorderTests
 
                 break;
             case 8:
-                Assert.Equal (new Rect (0, 0, 8, 5), win.Frame);
+                Assert.Equal (new Rectangle (0, 0, 8, 5), win.Frame);
 
                 expected = @"
  ╒════╕ 
@@ -176,7 +176,7 @@ public class BorderTests
 
                 break;
             case 9:
-                Assert.Equal (new Rect (0, 0, 9, 5), win.Frame);
+                Assert.Equal (new Rectangle (0, 0, 9, 5), win.Frame);
 
                 expected = @"
  ╒════╕  
@@ -186,7 +186,7 @@ public class BorderTests
 
                 break;
             case 10:
-                Assert.Equal (new Rect (0, 0, 10, 5), win.Frame);
+                Assert.Equal (new Rectangle (0, 0, 10, 5), win.Frame);
 
                 expected = @"
  ╒════╕   
@@ -232,7 +232,7 @@ public class BorderTests
         switch (width)
         {
             case 1:
-                Assert.Equal (new Rect (0, 0, 1, 4), win.Frame);
+                Assert.Equal (new Rectangle (0, 0, 1, 4), win.Frame);
 
                 expected = @"
@@ -241,7 +241,7 @@ public class BorderTests
 
                 break;
             case 2:
-                Assert.Equal (new Rect (0, 0, 2, 4), win.Frame);
+                Assert.Equal (new Rectangle (0, 0, 2, 4), win.Frame);
 
                 expected = @"
 ╔╗
@@ -250,7 +250,7 @@ public class BorderTests
 
                 break;
             case 3:
-                Assert.Equal (new Rect (0, 0, 3, 4), win.Frame);
+                Assert.Equal (new Rectangle (0, 0, 3, 4), win.Frame);
 
                 expected = @"
 ╔═╗
@@ -259,7 +259,7 @@ public class BorderTests
 
                 break;
             case 4:
-                Assert.Equal (new Rect (0, 0, 4, 4), win.Frame);
+                Assert.Equal (new Rectangle (0, 0, 4, 4), win.Frame);
 
                 expected = @"
  ╒╕ 
@@ -269,7 +269,7 @@ public class BorderTests
 
                 break;
             case 5:
-                Assert.Equal (new Rect (0, 0, 5, 4), win.Frame);
+                Assert.Equal (new Rectangle (0, 0, 5, 4), win.Frame);
 
                 expected = @"
  ╒═╕ 
@@ -279,7 +279,7 @@ public class BorderTests
 
                 break;
             case 6:
-                Assert.Equal (new Rect (0, 0, 6, 4), win.Frame);
+                Assert.Equal (new Rectangle (0, 0, 6, 4), win.Frame);
 
                 expected = @"
  ╒══╕ 
@@ -289,7 +289,7 @@ public class BorderTests
 
                 break;
             case 7:
-                Assert.Equal (new Rect (0, 0, 7, 4), win.Frame);
+                Assert.Equal (new Rectangle (0, 0, 7, 4), win.Frame);
 
                 expected = @"
  ╒═══╕ 
@@ -299,7 +299,7 @@ public class BorderTests
 
                 break;
             case 8:
-                Assert.Equal (new Rect (0, 0, 8, 4), win.Frame);
+                Assert.Equal (new Rectangle (0, 0, 8, 4), win.Frame);
 
                 expected = @"
  ╒════╕ 
@@ -309,7 +309,7 @@ public class BorderTests
 
                 break;
             case 9:
-                Assert.Equal (new Rect (0, 0, 9, 4), win.Frame);
+                Assert.Equal (new Rectangle (0, 0, 9, 4), win.Frame);
 
                 expected = @"
  ╒════╕  
@@ -319,7 +319,7 @@ public class BorderTests
 
                 break;
             case 10:
-                Assert.Equal (new Rect (0, 0, 10, 4), win.Frame);
+                Assert.Equal (new Rectangle (0, 0, 10, 4), win.Frame);
 
                 expected = @"
  ╒════╕   
@@ -365,7 +365,7 @@ public class BorderTests
         switch (width)
         {
             case 1:
-                Assert.Equal (new Rect (0, 0, 1, 4), win.Frame);
+                Assert.Equal (new Rectangle (0, 0, 1, 4), win.Frame);
 
                 expected = @"
@@ -374,7 +374,7 @@ public class BorderTests
 
                 break;
             case 2:
-                Assert.Equal (new Rect (0, 0, 2, 4), win.Frame);
+                Assert.Equal (new Rectangle (0, 0, 2, 4), win.Frame);
 
                 expected = @"
 ╔╗
@@ -383,7 +383,7 @@ public class BorderTests
 
                 break;
             case 3:
-                Assert.Equal (new Rect (0, 0, 3, 4), win.Frame);
+                Assert.Equal (new Rectangle (0, 0, 3, 4), win.Frame);
 
                 expected = @"
 ╔═╗
@@ -392,7 +392,7 @@ public class BorderTests
 
                 break;
             case 4:
-                Assert.Equal (new Rect (0, 0, 4, 4), win.Frame);
+                Assert.Equal (new Rectangle (0, 0, 4, 4), win.Frame);
 
                 expected = @"
  ╒╕ 
@@ -402,7 +402,7 @@ public class BorderTests
 
                 break;
             case 5:
-                Assert.Equal (new Rect (0, 0, 5, 4), win.Frame);
+                Assert.Equal (new Rectangle (0, 0, 5, 4), win.Frame);
 
                 expected = @"
  ╒═╕ 
@@ -412,7 +412,7 @@ public class BorderTests
 
                 break;
             case 6:
-                Assert.Equal (new Rect (0, 0, 6, 4), win.Frame);
+                Assert.Equal (new Rectangle (0, 0, 6, 4), win.Frame);
 
                 expected = @"
  ╒══╕ 
@@ -422,7 +422,7 @@ public class BorderTests
 
                 break;
             case 7:
-                Assert.Equal (new Rect (0, 0, 7, 4), win.Frame);
+                Assert.Equal (new Rectangle (0, 0, 7, 4), win.Frame);
 
                 expected = @"
  ╒═══╕ 
@@ -432,7 +432,7 @@ public class BorderTests
 
                 break;
             case 8:
-                Assert.Equal (new Rect (0, 0, 8, 4), win.Frame);
+                Assert.Equal (new Rectangle (0, 0, 8, 4), win.Frame);
 
                 expected = @"
  ╒════╕ 
@@ -442,7 +442,7 @@ public class BorderTests
 
                 break;
             case 9:
-                Assert.Equal (new Rect (0, 0, 9, 4), win.Frame);
+                Assert.Equal (new Rectangle (0, 0, 9, 4), win.Frame);
 
                 expected = @"
  ╒════╕  
@@ -452,7 +452,7 @@ public class BorderTests
 
                 break;
             case 10:
-                Assert.Equal (new Rect (0, 0, 10, 4), win.Frame);
+                Assert.Equal (new Rectangle (0, 0, 10, 4), win.Frame);
 
                 expected = @"
  ╒════╕   
@@ -670,8 +670,8 @@ public class BorderTests
 
         var view = new View { X = frameX, Y = frameY, Width = 10, Height = 10 };
         super.Add (view);
-        var expected = new Rect (expectedScreenX, expectedScreenY, 10, 10);
-        Rect actual = view.FrameToScreen ();
+        var expected = new Rectangle (expectedScreenX, expectedScreenY, 10, 10);
+        Rectangle actual = view.FrameToScreen ();
         Assert.Equal (expected, actual);
     }
 
@@ -702,8 +702,8 @@ public class BorderTests
 
         var view = new View { X = frameX, Y = frameY, Width = 10, Height = 10 };
         super.Add (view);
-        var expected = new Rect (expectedScreenX, expectedScreenY, 10, 10);
-        Rect actual = view.FrameToScreen ();
+        var expected = new Rectangle (expectedScreenX, expectedScreenY, 10, 10);
+        Rectangle actual = view.FrameToScreen ();
         Assert.Equal (expected, actual);
     }
 

+ 231 - 151
UnitTests/View/DrawTests.cs

@@ -1,8 +1,10 @@
-using System.Text;
+#nullable enable
+using System.Text;
 using Xunit.Abstractions;
 
 namespace Terminal.Gui.ViewsTests;
 
+[Trait("Category","Output")]
 public class DrawTests
 {
     private readonly ITestOutputHelper _output;
@@ -10,9 +12,10 @@ public class DrawTests
 
     [Fact]
     [AutoInitShutdown]
+    [Trait("Category","Unicode")]
     public void CJK_Compatibility_Ideographs_ConsoleWidth_ColumnWidth_Equal_Two ()
     {
-        var us = "\U0000f900";
+        const string us = "\U0000f900";
         var r = (Rune)0xf900;
 
         Assert.Equal ("豈", us);
@@ -32,14 +35,16 @@ public class DrawTests
         Application.Begin (top);
         ((FakeDriver)Application.Driver).SetBufferSize (10, 4);
 
-        var expected = @"
-┌┤豈├────┐
-│豈      │
-│豈      │
-└────────┘";
-        TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
+        const string expectedOutput = """
 
-        TestHelpers.AssertDriverContentsAre (expected, _output);
+                                      ┌┤豈├────┐
+                                      │豈      │
+                                      │豈      │
+                                      └────────┘
+                                      """;
+        TestHelpers.AssertDriverContentsWithFrameAre (expectedOutput, _output);
+
+        TestHelpers.AssertDriverContentsAre (expectedOutput, _output);
 
         Attribute [] expectedColors =
         {
@@ -54,11 +59,13 @@ public class DrawTests
         };
 
         TestHelpers.AssertDriverAttributesAre (
-                                               @"
-0011000000
-0000000000
-0111000000
-0000000000",
+                                               """
+
+                                               0011000000
+                                               0000000000
+                                               0111000000
+                                               0000000000
+                                               """,
                                                Application.Driver,
                                                expectedColors
                                               );
@@ -67,20 +74,23 @@ public class DrawTests
     // TODO: Refactor this test to not depend on TextView etc... Make it as primitive as possible
     [Fact]
     [AutoInitShutdown]
+    [Trait("Category","Unicode")]
     public void Clipping_AddRune_Left_Or_Right_Replace_Previous_Or_Next_Wide_Rune_With_Space ()
     {
         var tv = new TextView
         {
             Width = Dim.Fill (),
             Height = Dim.Fill (),
-            Text = @"これは広いルーンラインです。
-これは広いルーンラインです。
-これは広いルーンラインです。
-これは広いルーンラインです。
-これは広いルーンラインです。
-これは広いルーンラインです。
-これは広いルーンラインです。
-これは広いルーンラインです。"
+            Text = """
+                   これは広いルーンラインです。
+                   これは広いルーンラインです。
+                   これは広いルーンラインです。
+                   これは広いルーンラインです。
+                   これは広いルーンラインです。
+                   これは広いルーンラインです。
+                   これは広いルーンラインです。
+                   これは広いルーンラインです。
+                   """
         };
         var win = new Window { Width = Dim.Fill (), Height = Dim.Fill () };
         win.Add (tv);
@@ -96,24 +106,27 @@ public class DrawTests
         Application.Begin (dg);
         ((FakeDriver)Application.Driver).SetBufferSize (30, 10);
 
-        var expected = @"
-┌────────────────────────────┐
-│これは広いルーンラインです。│
-│�┌────────────┐�ラインです。│
-│�│ワイドルーン│�ラインです。│
-│�└────────────┘�ラインです。│
-│これは広いルーンラインです。│
-│これは広いルーンラインです。│
-│これは広いルーンラインです。│
-│これは広いルーンラインです。│
-└────────────────────────────┘";
-
-        Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (0, 0, 30, 10), pos);
+        const string expectedOutput = """
+
+                                      ┌────────────────────────────┐
+                                      │これは広いルーンラインです。│
+                                      │�┌────────────┐�ラインです。│
+                                      │�│ワイドルーン│�ラインです。│
+                                      │�└────────────┘�ラインです。│
+                                      │これは広いルーンラインです。│
+                                      │これは広いルーンラインです。│
+                                      │これは広いルーンラインです。│
+                                      │これは広いルーンラインです。│
+                                      └────────────────────────────┘
+                                      """;
+
+        Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expectedOutput, _output);
+        Assert.Equal (new Rectangle (0, 0, 30, 10), pos);
     }
 
     [Fact]
     [AutoInitShutdown]
+    [Trait("Category","Output")]
     public void Colors_On_TextAlignment_Right_And_Bottom ()
     {
         var viewRight = new View
@@ -142,26 +155,30 @@ public class DrawTests
         ((FakeDriver)Application.Driver).SetBufferSize (7, 7);
 
         TestHelpers.AssertDriverContentsWithFrameAre (
-                                                      @"
-  Test
-      
-      
-T     
-e     
-s     
-t     ",
+                                                      """
+
+                                                        Test
+                                                            
+                                                            
+                                                      T     
+                                                      e     
+                                                      s     
+                                                      t     
+                                                      """,
                                                       _output
                                                      );
 
         TestHelpers.AssertDriverAttributesAre (
-                                               @"
-000000
-0
-0
-0
-0
-0
-0",
+                                               """
+
+                                               000000
+                                               0
+                                               0
+                                               0
+                                               0
+                                               0
+                                               0
+                                               """,
                                                Application.Driver,
                                                Colors.ColorSchemes ["Base"].Normal
                                               );
@@ -176,15 +193,17 @@ t     ",
         view.EndInit ();
         view.SetRelativeLayout (Application.Driver.Bounds);
 
-        Assert.Equal ("(0,0,2,2)", view.Frame.ToString ());
-        Assert.Equal ("(0,0,0,0)", view.Bounds.ToString ());
+        Assert.Equal (new (0,0,2,2), view.Frame);
+        Assert.Equal (Rectangle.Empty, view.Bounds);
 
         view.Draw ();
 
         TestHelpers.AssertDriverContentsWithFrameAre (
-                                                      @"
-┌┐
-└┘",
+                                                      """
+
+                                                      ┌┐
+                                                      └┘
+                                                      """,
                                                       _output
                                                      );
     }
@@ -199,16 +218,12 @@ t     ",
         view.EndInit ();
         view.SetRelativeLayout (Application.Driver.Bounds);
 
-        Assert.Equal ("(0,0,2,1)", view.Frame.ToString ());
-        Assert.Equal ("(0,0,0,0)", view.Bounds.ToString ());
+        Assert.Equal (new (0,0,2,1), view.Frame);
+        Assert.Equal (Rectangle.Empty, view.Bounds);
 
         view.Draw ();
 
-        TestHelpers.AssertDriverContentsWithFrameAre (
-                                                      @"
-",
-                                                      _output
-                                                     );
+        TestHelpers.AssertDriverContentsWithFrameAre (string.Empty, _output);
     }
 
     [Fact]
@@ -221,15 +236,17 @@ t     ",
         view.EndInit ();
         view.SetRelativeLayout (Application.Driver.Bounds);
 
-        Assert.Equal ("(0,0,1,2)", view.Frame.ToString ());
-        Assert.Equal ("(0,0,0,0)", view.Bounds.ToString ());
+        Assert.Equal (new (0,0,1,2), view.Frame);
+        Assert.Equal (Rectangle.Empty, view.Bounds);
 
         view.Draw ();
 
         TestHelpers.AssertDriverContentsWithFrameAre (
-                                                      @"
-│
-│",
+                                                      """
+
+                                                      │
+                                                      │
+                                                      """,
                                                       _output
                                                      );
     }
@@ -244,15 +261,17 @@ t     ",
         view.EndInit ();
         view.SetRelativeLayout (Application.Driver.Bounds);
 
-        Assert.Equal ("(0,0,1,2)", view.Frame.ToString ());
-        Assert.Equal ("(0,0,0,0)", view.Bounds.ToString ());
+        Assert.Equal (new (0,0,1,2), view.Frame);
+        Assert.Equal (Rectangle.Empty, view.Bounds);
 
         view.Draw ();
 
         TestHelpers.AssertDriverContentsWithFrameAre (
-                                                      @"
-│
-│",
+                                                      """
+
+                                                      │
+                                                      │
+                                                      """,
                                                       _output
                                                      );
     }
@@ -268,15 +287,17 @@ t     ",
         view.EndInit ();
         view.SetRelativeLayout (Application.Driver.Bounds);
 
-        Assert.Equal ("(0,0,2,1)", view.Frame.ToString ());
-        Assert.Equal ("(0,0,0,0)", view.Bounds.ToString ());
+        Assert.Equal (new (0,0,2,1), view.Frame);
+        Assert.Equal (Rectangle.Empty, view.Bounds);
 
         view.Draw ();
 
         // BUGBUG: Wha? Is this right? Shouldn't it be "└┘"???
         TestHelpers.AssertDriverContentsWithFrameAre (
-                                                      @"
-┌┐",
+                                                      """
+
+                                                      ┌┐
+                                                      """,
                                                       _output
                                                      );
     }
@@ -291,12 +312,41 @@ t     ",
             X = 1,
             Width = 1,
             Height = 7,
-            Text = "s\nu\nb\nV\ni\ne\nw"
+            Text = """
+            s
+            u
+            b
+            V
+            i
+            e
+            w
+            """
         };
 
         var view = new View
         {
-            Id = "view", Width = 2, Height = 20, Text = "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n0\n1\n2\n3\n4\n5\n6\n7\n8\n9"
+            Id = "view", Width = 2, Height = 20, Text = """
+            0
+            1
+            2
+            3
+            4
+            5
+            6
+            7
+            8
+            9
+            0
+            1
+            2
+            3
+            4
+            5
+            6
+            7
+            8
+            9
+            """
         };
         view.Add (subView);
         var content = new View { Id = "content", Width = 20, Height = 20 };
@@ -317,12 +367,14 @@ t     ",
         Application.Begin (top);
 
         TestHelpers.AssertDriverContentsWithFrameAre (
-                                                      @"
- 0s
- 1u
- 2b
- 3V
- 4i",
+                                                      """
+
+                                                       0s
+                                                       1u
+                                                       2b
+                                                       3V
+                                                       4i
+                                                      """,
                                                       _output
                                                      );
 
@@ -330,12 +382,14 @@ t     ",
         Application.Refresh ();
 
         TestHelpers.AssertDriverContentsWithFrameAre (
-                                                      @"
- s
- u
- b
- V
- i",
+                                                      """
+
+                                                       s
+                                                       u
+                                                       b
+                                                       V
+                                                       i
+                                                      """,
                                                       _output
                                                      );
 
@@ -348,12 +402,14 @@ t     ",
         Application.Refresh ();
 
         TestHelpers.AssertDriverContentsWithFrameAre (
-                                                      @"
- 1u
- 2b
- 3V
- 4i
- 5e",
+                                                      """
+
+                                                       1u
+                                                       2b
+                                                       3V
+                                                       4i
+                                                       5e
+                                                      """,
                                                       _output
                                                      );
 
@@ -361,12 +417,14 @@ t     ",
         Application.Refresh ();
 
         TestHelpers.AssertDriverContentsWithFrameAre (
-                                                      @"
- 6w
- 7 
- 8 
- 9 
- 0 ",
+                                                      """
+
+                                                       6w
+                                                       7 
+                                                       8 
+                                                       9 
+                                                       0 
+                                                      """,
                                                       _output
                                                      );
 
@@ -374,8 +432,10 @@ t     ",
         Application.Refresh ();
 
         TestHelpers.AssertDriverContentsWithFrameAre (
-                                                      @"
- 9",
+                                                      """
+
+                                                       9
+                                                      """,
                                                       _output
                                                      );
 
@@ -393,7 +453,7 @@ t     ",
     [AutoInitShutdown]
     public void Draw_Negative_Bounds_Horizontal_Without_New_Lines ()
     {
-        // BUGBUG: This previously assumed the default height of a View was 1. 
+        // BUGBUG: This previously assumed the default height of a View was 1.
         var subView = new View
         {
             Id = "subView",
@@ -427,9 +487,11 @@ t     ",
         Application.Begin (top);
 
         TestHelpers.AssertDriverContentsWithFrameAre (
-                                                      @"
- 01234
- subVi",
+                                                      """
+
+                                                       01234
+                                                       subVi
+                                                      """,
                                                       _output
                                                      );
 
@@ -437,9 +499,11 @@ t     ",
         Application.Refresh ();
 
         TestHelpers.AssertDriverContentsWithFrameAre (
-                                                      @"
- 12345
- ubVie",
+                                                      """
+
+                                                       12345
+                                                       ubVie
+                                                      """,
                                                       _output
                                                      );
 
@@ -447,8 +511,10 @@ t     ",
         Application.Refresh ();
 
         TestHelpers.AssertDriverContentsWithFrameAre (
-                                                      @"
- ubVie",
+                                                      """
+
+                                                       ubVie
+                                                      """,
                                                       _output
                                                      );
 
@@ -503,12 +569,14 @@ t     ",
         Application.Begin (top);
 
         TestHelpers.AssertDriverContentsWithFrameAre (
-                                                      @"
- 0s
- 1u
- 2b
- 3V
- 4i",
+                                                      """
+
+                                                       0s
+                                                       1u
+                                                       2b
+                                                       3V
+                                                       4i
+                                                      """,
                                                       _output
                                                      );
 
@@ -516,12 +584,14 @@ t     ",
         Application.Refresh ();
 
         TestHelpers.AssertDriverContentsWithFrameAre (
-                                                      @"
- s
- u
- b
- V
- i",
+                                                      """
+
+                                                       s
+                                                       u
+                                                       b
+                                                       V
+                                                       i
+                                                      """,
                                                       _output
                                                      );
 
@@ -534,12 +604,14 @@ t     ",
         Application.Refresh ();
 
         TestHelpers.AssertDriverContentsWithFrameAre (
-                                                      @"
- 1u
- 2b
- 3V
- 4i
- 5e",
+                                                      """
+
+                                                       1u
+                                                       2b
+                                                       3V
+                                                       4i
+                                                       5e
+                                                      """,
                                                       _output
                                                      );
 
@@ -547,12 +619,14 @@ t     ",
         Application.Refresh ();
 
         TestHelpers.AssertDriverContentsWithFrameAre (
-                                                      @"
- 6w
- 7 
- 8 
- 9 
- 0 ",
+                                                      """
+
+                                                       6w
+                                                       7 
+                                                       8 
+                                                       9 
+                                                       0 
+                                                      """,
                                                       _output
                                                      );
 
@@ -560,8 +634,10 @@ t     ",
         Application.Refresh ();
 
         TestHelpers.AssertDriverContentsWithFrameAre (
-                                                      @"
- 9",
+                                                      """
+
+                                                       9
+                                                      """,
                                                       _output
                                                      );
 
@@ -612,11 +688,13 @@ t     ",
         Application.Begin (top);
         ((FakeDriver)Application.Driver).SetBufferSize (10, 4);
 
-        var expected = @"
-┌┤𝔹├─────┐
-│𝔹       │
-│𝔹       │
-└────────┘";
+        var expected = """
+
+            ┌┤𝔹├─────┐
+            │𝔹       │
+            │𝔹       │
+            └────────┘
+            """;
         TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
 
         TestHelpers.AssertDriverContentsAre (expected, _output);
@@ -634,11 +712,13 @@ t     ",
         };
 
         TestHelpers.AssertDriverAttributesAre (
-                                               @"
-0010000000
-0000000000
-0111000000
-0000000000",
+                                               """
+
+                                               0010000000
+                                               0000000000
+                                               0111000000
+                                               0000000000
+                                               """,
                                                Application.Driver,
                                                expectedColors
                                               );

+ 4 - 4
UnitTests/View/FrameTests.cs

@@ -17,8 +17,8 @@ public class FrameTests
     public void FrameToScreen_NoSuperView (int frameX, int frameY, int expectedScreenX, int expectedScreenY)
     {
         var view = new View { X = frameX, Y = frameY, Width = 10, Height = 10 };
-        var expected = new Rect (expectedScreenX, expectedScreenY, 10, 10);
-        Rect actual = view.FrameToScreen ();
+        var expected = new Rectangle (expectedScreenX, expectedScreenY, 10, 10);
+        Rectangle actual = view.FrameToScreen ();
         Assert.Equal (expected, actual);
     }
 
@@ -42,8 +42,8 @@ public class FrameTests
 
         var view = new View { X = frameX, Y = frameY, Width = 10, Height = 10 };
         super.Add (view);
-        var expected = new Rect (expectedScreenX, expectedScreenY, 10, 10);
-        Rect actual = view.FrameToScreen ();
+        var expected = new Rectangle (expectedScreenX, expectedScreenY, 10, 10);
+        Rectangle actual = view.FrameToScreen ();
         Assert.Equal (expected, actual);
     }
 }

+ 52 - 52
UnitTests/View/Layout/AbsoluteLayoutTests.cs

@@ -15,8 +15,8 @@ public class AbsoluteLayoutTests
     [TestRespondersDisposed]
     public void AbsoluteLayout_Change_Frame ()
     {
-        var frame = new Rect (1, 2, 3, 4);
-        var newFrame = new Rect (1, 2, 30, 40);
+        var frame = new Rectangle (1, 2, 3, 4);
+        var newFrame = new Rectangle (1, 2, 30, 40);
 
         var v = new View ();
         Assert.True (v.LayoutStyle == LayoutStyle.Absolute);
@@ -30,7 +30,7 @@ public class AbsoluteLayoutTests
         Assert.Equal (newFrame, v.Frame);
 
         Assert.Equal (
-                      new Rect (0, 0, newFrame.Width, newFrame.Height),
+                      new Rectangle (0, 0, newFrame.Width, newFrame.Height),
                       v.Bounds
                      ); // With Absolute Bounds *is* deterministic before Layout
         Assert.Equal (Pos.At (1), v.X);
@@ -45,7 +45,7 @@ public class AbsoluteLayoutTests
         Assert.Equal (newFrame, v.Frame);
 
         Assert.Equal (
-                      new Rect (0, 0, newFrame.Width, newFrame.Height),
+                      new Rectangle (0, 0, newFrame.Width, newFrame.Height),
                       v.Bounds
                      ); // With Absolute Bounds *is* deterministic before Layout
         Assert.Equal (Pos.At (1), v.X);
@@ -54,14 +54,14 @@ public class AbsoluteLayoutTests
         Assert.Equal (Dim.Sized (40), v.Height);
         v.Dispose ();
 
-        newFrame = new Rect (10, 20, 30, 40);
+        newFrame = new Rectangle (10, 20, 30, 40);
         v = new View { Frame = frame };
         v.Frame = newFrame;
         Assert.True (v.LayoutStyle == LayoutStyle.Absolute);
         Assert.Equal (newFrame, v.Frame);
 
         Assert.Equal (
-                      new Rect (0, 0, newFrame.Width, newFrame.Height),
+                      new Rectangle (0, 0, newFrame.Width, newFrame.Height),
                       v.Bounds
                      ); // With Absolute Bounds *is* deterministic before Layout
         Assert.Equal (Pos.At (10), v.X);
@@ -76,7 +76,7 @@ public class AbsoluteLayoutTests
         Assert.Equal (newFrame, v.Frame);
 
         Assert.Equal (
-                      new Rect (0, 0, newFrame.Width, newFrame.Height),
+                      new Rectangle (0, 0, newFrame.Width, newFrame.Height),
                       v.Bounds
                      ); // With Absolute Bounds *is* deterministic before Layout
         Assert.Equal (Pos.At (10), v.X);
@@ -90,8 +90,8 @@ public class AbsoluteLayoutTests
     [TestRespondersDisposed]
     public void AbsoluteLayout_Change_Height_or_Width_Absolute ()
     {
-        var frame = new Rect (1, 2, 3, 4);
-        var newFrame = new Rect (1, 2, 30, 40);
+        var frame = new Rectangle (1, 2, 3, 4);
+        var newFrame = new Rectangle (1, 2, 30, 40);
 
         var v = new View { Frame = frame };
         v.Height = newFrame.Height;
@@ -100,7 +100,7 @@ public class AbsoluteLayoutTests
         Assert.Equal (newFrame, v.Frame);
 
         Assert.Equal (
-                      new Rect (0, 0, newFrame.Width, newFrame.Height),
+                      new Rectangle (0, 0, newFrame.Width, newFrame.Height),
                       v.Bounds
                      ); // With Absolute Bounds *is* deterministic before Layout
         Assert.Equal (Pos.At (1), v.X);
@@ -114,7 +114,7 @@ public class AbsoluteLayoutTests
     [TestRespondersDisposed]
     public void AbsoluteLayout_Change_Height_or_Width_MakesComputed ()
     {
-        var v = new View { Frame = Rect.Empty };
+        var v = new View { Frame = Rectangle.Empty };
         v.Height = Dim.Fill ();
         v.Width = Dim.Fill ();
         Assert.True (v.LayoutStyle == LayoutStyle.Computed);
@@ -125,8 +125,8 @@ public class AbsoluteLayoutTests
     [TestRespondersDisposed]
     public void AbsoluteLayout_Change_X_or_Y_Absolute ()
     {
-        var frame = new Rect (1, 2, 3, 4);
-        var newFrame = new Rect (10, 20, 3, 4);
+        var frame = new Rectangle (1, 2, 3, 4);
+        var newFrame = new Rectangle (10, 20, 3, 4);
 
         var v = new View { Frame = frame };
         v.X = newFrame.X;
@@ -135,7 +135,7 @@ public class AbsoluteLayoutTests
         Assert.Equal (newFrame, v.Frame);
 
         Assert.Equal (
-                      new Rect (0, 0, newFrame.Width, newFrame.Height),
+                      new Rectangle (0, 0, newFrame.Width, newFrame.Height),
                       v.Bounds
                      ); // With Absolute Bounds *is* deterministic before Layout
         Assert.Equal ($"Absolute({newFrame.X})", v.X.ToString ());
@@ -149,7 +149,7 @@ public class AbsoluteLayoutTests
     [TestRespondersDisposed]
     public void AbsoluteLayout_Change_X_or_Y_MakesComputed ()
     {
-        var v = new View { Frame = Rect.Empty };
+        var v = new View { Frame = Rectangle.Empty };
         v.X = Pos.Center ();
         v.Y = Pos.Center ();
         Assert.True (v.LayoutStyle == LayoutStyle.Computed);
@@ -160,7 +160,7 @@ public class AbsoluteLayoutTests
     [TestRespondersDisposed]
     public void AbsoluteLayout_Change_X_Y_Height_Width_Absolute ()
     {
-        var v = new View { Frame = Rect.Empty };
+        var v = new View { Frame = Rectangle.Empty };
         v.X = 1;
         v.Y = 2;
         v.Height = 3;
@@ -168,7 +168,7 @@ public class AbsoluteLayoutTests
         Assert.True (v.LayoutStyle == LayoutStyle.Absolute);
         v.Dispose ();
 
-        v = new View { Frame = Rect.Empty };
+        v = new View { Frame = Rectangle.Empty };
         v.X = Pos.Center ();
         v.Y = Pos.Center ();
         v.Width = Dim.Fill ();
@@ -176,7 +176,7 @@ public class AbsoluteLayoutTests
         Assert.True (v.LayoutStyle == LayoutStyle.Computed);
         v.Dispose ();
 
-        v = new View { Frame = Rect.Empty };
+        v = new View { Frame = Rectangle.Empty };
         v.X = Pos.Center ();
         v.Y = Pos.Center ();
         v.Width = Dim.Fill ();
@@ -187,7 +187,7 @@ public class AbsoluteLayoutTests
         Assert.True (v.LayoutStyle == LayoutStyle.Computed);
         v.Dispose ();
 
-        v = new View { Frame = Rect.Empty };
+        v = new View { Frame = Rectangle.Empty };
         v.X = Pos.Center ();
         v.Y = Pos.Center ();
         v.Width = Dim.Fill ();
@@ -198,7 +198,7 @@ public class AbsoluteLayoutTests
         Assert.True (v.LayoutStyle == LayoutStyle.Computed);
         v.Dispose ();
 
-        v = new View { Frame = Rect.Empty };
+        v = new View { Frame = Rectangle.Empty };
         v.X = Pos.Center ();
         v.Y = Pos.Center ();
         v.Width = Dim.Fill ();
@@ -209,7 +209,7 @@ public class AbsoluteLayoutTests
         Assert.True (v.LayoutStyle == LayoutStyle.Computed);
         v.Dispose ();
 
-        v = new View { Frame = Rect.Empty };
+        v = new View { Frame = Rectangle.Empty };
         v.X = Pos.Center ();
         v.Y = Pos.Center ();
         v.Width = Dim.Fill ();
@@ -220,7 +220,7 @@ public class AbsoluteLayoutTests
         Assert.True (v.LayoutStyle == LayoutStyle.Computed);
         v.Dispose ();
 
-        v = new View { Frame = Rect.Empty };
+        v = new View { Frame = Rectangle.Empty };
         v.X = Pos.Center ();
         v.Y = Pos.Center ();
         v.Width = Dim.Fill ();
@@ -243,13 +243,13 @@ public class AbsoluteLayoutTests
         Assert.True (v.LayoutStyle == LayoutStyle.Absolute);
         v.Dispose ();
 
-        var frame = Rect.Empty;
+        var frame = Rectangle.Empty;
         v = new View { Frame = frame };
         Assert.True (v.LayoutStyle == LayoutStyle.Absolute);
         Assert.Equal (frame, v.Frame);
 
         Assert.Equal (
-                      new Rect (0, 0, frame.Width, frame.Height),
+                      new Rectangle (0, 0, frame.Width, frame.Height),
                       v.Bounds
                      ); // With Absolute Bounds *is* deterministic before Layout
         Assert.Equal (Pos.At (0), v.X);
@@ -258,13 +258,13 @@ public class AbsoluteLayoutTests
         Assert.Equal (Dim.Sized (0), v.Height);
         v.Dispose ();
 
-        frame = new Rect (1, 2, 3, 4);
+        frame = new Rectangle (1, 2, 3, 4);
         v = new View { Frame = frame };
         Assert.True (v.LayoutStyle == LayoutStyle.Absolute);
         Assert.Equal (frame, v.Frame);
 
         Assert.Equal (
-                      new Rect (0, 0, frame.Width, frame.Height),
+                      new Rectangle (0, 0, frame.Width, frame.Height),
                       v.Bounds
                      ); // With Absolute Bounds *is* deterministic before Layout
         Assert.Equal (Pos.At (1), v.X);
@@ -278,7 +278,7 @@ public class AbsoluteLayoutTests
         Assert.Equal (frame, v.Frame);
 
         Assert.Equal (
-                      new Rect (0, 0, frame.Width, frame.Height),
+                      new Rectangle (0, 0, frame.Width, frame.Height),
                       v.Bounds
                      ); // With Absolute Bounds *is* deterministic before Layout
         Assert.Equal (Pos.At (1), v.X);
@@ -293,8 +293,8 @@ public class AbsoluteLayoutTests
         // BUGBUG: v2 - I think the default size should be 0,0 not 1,1
         // That is correct it should be 0,0 because AutoSize is false
         // and the size wasn't set on the initializer
-        Assert.Equal (new Rect (frame.X, frame.Y, 0, 0), v.Frame);
-        Assert.Equal (new Rect (0, 0, 0, 0), v.Bounds); // With Absolute Bounds *is* deterministic before Layout
+        Assert.Equal (new Rectangle (frame.X, frame.Y, 0, 0), v.Frame);
+        Assert.Equal (new Rectangle (0, 0, 0, 0), v.Bounds); // With Absolute Bounds *is* deterministic before Layout
         Assert.Equal (Pos.At (1), v.X);
         Assert.Equal (Pos.At (2), v.Y);
         Assert.Equal (Dim.Sized (0), v.Width);
@@ -303,8 +303,8 @@ public class AbsoluteLayoutTests
 
         v = new View ();
         Assert.True (v.LayoutStyle == LayoutStyle.Absolute);
-        Assert.Equal (new Rect (0, 0, 0, 0), v.Frame);
-        Assert.Equal (new Rect (0, 0, 0, 0), v.Bounds); // With Absolute Bounds *is* deterministic before Layout
+        Assert.Equal (new Rectangle (0, 0, 0, 0), v.Frame);
+        Assert.Equal (new Rectangle (0, 0, 0, 0), v.Bounds); // With Absolute Bounds *is* deterministic before Layout
         Assert.Equal (Pos.At (0), v.X);
         Assert.Equal (Pos.At (0), v.Y);
         Assert.Equal (Dim.Sized (0), v.Width);
@@ -313,8 +313,8 @@ public class AbsoluteLayoutTests
 
         v = new View { X = frame.X, Y = frame.Y, Width = frame.Width, Height = frame.Height };
         Assert.True (v.LayoutStyle == LayoutStyle.Absolute);
-        Assert.Equal (new Rect (frame.X, frame.Y, 3, 4), v.Frame);
-        Assert.Equal (new Rect (0, 0, 3, 4), v.Bounds); // With Absolute Bounds *is* deterministic before Layout
+        Assert.Equal (new Rectangle (frame.X, frame.Y, 3, 4), v.Frame);
+        Assert.Equal (new Rectangle (0, 0, 3, 4), v.Bounds); // With Absolute Bounds *is* deterministic before Layout
         Assert.Equal (Pos.At (1), v.X);
         Assert.Equal (Pos.At (2), v.Y);
         Assert.Equal (Dim.Sized (3), v.Width);
@@ -326,7 +326,7 @@ public class AbsoluteLayoutTests
     [TestRespondersDisposed]
     public void AbsoluteLayout_LayoutSubviews ()
     {
-        var superRect = new Rect (0, 0, 100, 100);
+        var superRect = new Rectangle (0, 0, 100, 100);
         var super = new View { Frame = superRect, Text = "super" };
         Assert.True (super.LayoutStyle == LayoutStyle.Absolute);
         var v1 = new View { X = 0, Y = 0, Width = 10, Height = 10 };
@@ -340,8 +340,8 @@ public class AbsoluteLayoutTests
         Assert.True (v2.LayoutStyle == LayoutStyle.Absolute);
 
         super.LayoutSubviews ();
-        Assert.Equal (new Rect (0, 0, 10, 10), v1.Frame);
-        Assert.Equal (new Rect (10, 10, 10, 10), v2.Frame);
+        Assert.Equal (new Rectangle (0, 0, 10, 10), v1.Frame);
+        Assert.Equal (new Rectangle (10, 10, 10, 10), v2.Frame);
         super.Dispose ();
     }
 
@@ -350,19 +350,19 @@ public class AbsoluteLayoutTests
     {
         // TODO: Should we enforce Bounds.X/Y == 0? The code currently ignores value.X/Y which is
         // TODO: correct behavior, but is silent. Perhaps an exception?
-        var frame = new Rect (1, 2, 3, 4);
-        var newBounds = new Rect (10, 20, 30, 40);
+        var frame = new Rectangle (1, 2, 3, 4);
+        var newBounds = new Rectangle (10, 20, 30, 40);
         var view = new View { Frame = frame };
         view.Bounds = newBounds;
-        Assert.Equal (new Rect (0, 0, 30, 40), view.Bounds);
-        Assert.Equal (new Rect (1, 2, 30, 40), view.Frame);
+        Assert.Equal (new Rectangle (0, 0, 30, 40), view.Bounds);
+        Assert.Equal (new Rectangle (1, 2, 30, 40), view.Frame);
     }
 
     [Fact]
     public void AbsoluteLayout_Setting_Bounds_Sets_Frame ()
     {
-        var frame = new Rect (1, 2, 3, 4);
-        var newBounds = new Rect (0, 0, 30, 40);
+        var frame = new Rectangle (1, 2, 3, 4);
+        var newBounds = new Rectangle (0, 0, 30, 40);
 
         var v = new View { Frame = frame };
         Assert.True (v.LayoutStyle == LayoutStyle.Absolute);
@@ -370,18 +370,18 @@ public class AbsoluteLayoutTests
         v.Bounds = newBounds;
         Assert.True (v.LayoutStyle == LayoutStyle.Absolute);
         Assert.Equal (newBounds, v.Bounds);
-        Assert.Equal (new Rect (1, 2, newBounds.Width, newBounds.Height), v.Frame);
-        Assert.Equal (new Rect (0, 0, newBounds.Width, newBounds.Height), v.Bounds);
+        Assert.Equal (new Rectangle (1, 2, newBounds.Width, newBounds.Height), v.Frame);
+        Assert.Equal (new Rectangle (0, 0, newBounds.Width, newBounds.Height), v.Bounds);
         Assert.Equal (Pos.At (1), v.X);
         Assert.Equal (Pos.At (2), v.Y);
         Assert.Equal (Dim.Sized (30), v.Width);
         Assert.Equal (Dim.Sized (40), v.Height);
 
-        newBounds = new Rect (0, 0, 3, 4);
+        newBounds = new Rectangle (0, 0, 3, 4);
         v.Bounds = newBounds;
         Assert.Equal (newBounds, v.Bounds);
-        Assert.Equal (new Rect (1, 2, newBounds.Width, newBounds.Height), v.Frame);
-        Assert.Equal (new Rect (0, 0, newBounds.Width, newBounds.Height), v.Bounds);
+        Assert.Equal (new Rectangle (1, 2, newBounds.Width, newBounds.Height), v.Frame);
+        Assert.Equal (new Rectangle (0, 0, newBounds.Width, newBounds.Height), v.Bounds);
         Assert.Equal (Pos.At (1), v.X);
         Assert.Equal (Pos.At (2), v.Y);
         Assert.Equal (Dim.Sized (3), v.Width);
@@ -390,23 +390,23 @@ public class AbsoluteLayoutTests
         v.BorderStyle = LineStyle.Single;
 
         // Bounds should shrink
-        Assert.Equal (new Rect (0, 0, 1, 2), v.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 1, 2), v.Bounds);
 
         // Frame should not change
-        Assert.Equal (new Rect (1, 2, 3, 4), v.Frame);
+        Assert.Equal (new Rectangle (1, 2, 3, 4), v.Frame);
         Assert.Equal (Pos.At (1), v.X);
         Assert.Equal (Pos.At (2), v.Y);
         Assert.Equal (Dim.Sized (3), v.Width);
         Assert.Equal (Dim.Sized (4), v.Height);
 
         // Now set bounds bigger as before
-        newBounds = new Rect (0, 0, 3, 4);
+        newBounds = new Rectangle (0, 0, 3, 4);
         v.Bounds = newBounds;
         Assert.Equal (newBounds, v.Bounds);
 
         // Frame grows because there's now a border
-        Assert.Equal (new Rect (1, 2, 5, 6), v.Frame);
-        Assert.Equal (new Rect (0, 0, newBounds.Width, newBounds.Height), v.Bounds);
+        Assert.Equal (new Rectangle (1, 2, 5, 6), v.Frame);
+        Assert.Equal (new Rectangle (0, 0, newBounds.Width, newBounds.Height), v.Bounds);
         Assert.Equal (Pos.At (1), v.X);
         Assert.Equal (Pos.At (2), v.Y);
         Assert.Equal (Dim.Sized (5), v.Width);

+ 24 - 24
UnitTests/View/Layout/DimTests.cs

@@ -1,4 +1,4 @@
-using System.Globalization;
+using System.Globalization;
 using System.Text;
 using Xunit.Abstractions;
 
@@ -208,7 +208,7 @@ public class DimTests
         Assert.Equal (2, v.Height = 2);
 
         // Force v to be LayoutStyle.Absolute;
-        v.Frame = new Rect (0, 1, 3, 4);
+        v.Frame = new Rectangle (0, 1, 3, 4);
         Assert.Equal (LayoutStyle.Absolute, v.LayoutStyle);
         t.LayoutSubviews ();
 
@@ -474,13 +474,13 @@ public class DimTests
     [TestRespondersDisposed]
     public void Height_SetsValue ()
     {
-        var testVal = Rect.Empty;
+        var testVal = Rectangle.Empty;
         var testValview = new View { Frame = testVal };
         Dim dim = Dim.Height (testValview);
         Assert.Equal ($"View(Height,View(){testVal})", dim.ToString ());
         testValview.Dispose ();
 
-        testVal = new Rect (1, 2, 3, 4);
+        testVal = new Rectangle (1, 2, 3, 4);
         testValview = new View { Frame = testVal };
         dim = Dim.Height (testValview);
         Assert.Equal ($"View(Height,View(){testVal})", dim.ToString ());
@@ -505,7 +505,7 @@ public class DimTests
         Assert.Equal (dimCombine._right, dimAbsolute);
         Assert.Equal (20, dimCombine.Anchor (100));
 
-        var view = new View { Frame = new Rect (20, 10, 20, 1) };
+        var view = new View { Frame = new Rectangle (20, 10, 20, 1) };
         var dimViewHeight = new Dim.DimView (view, 0);
         Assert.Equal (1, dimViewHeight.Anchor (0));
         var dimViewWidth = new Dim.DimView (view, 1);
@@ -631,9 +631,9 @@ public class DimTests
                                             Assert.Equal (5, f2.Frame.Height);
 
                     #if DEBUG
-                       Assert.Equal ("Combine(View(Width,FrameView(f1)(0,0,49,5))-Absolute(2))", v1.Width.ToString ());
+                       Assert.Equal ($"Combine(View(Width,FrameView(f1){f1.Border.Frame})-Absolute(2))", v1.Width.ToString ());
                     #else
-                       Assert.Equal ("Combine(View(Width,FrameView()(0,0,49,5))-Absolute(2))", v1.Width.ToString ());
+                       Assert.Equal ($"Combine(View(Width,FrameView(){f1.Border.Frame})-Absolute(2))", v1.Width.ToString ());
                     #endif
                        Assert.Equal ("Combine(Fill(0)-Absolute(2))", v1.Height.ToString ());
                        Assert.Equal (47, v1.Frame.Width); // 49-2=47
@@ -641,11 +641,11 @@ public class DimTests
 
                    #if DEBUG
                        Assert.Equal (
-                                     "Combine(View(Width,FrameView(f2)(49,0,49,5))-Absolute(2))",
+                                     $"Combine(View(Width,FrameView(f2){f2.Frame})-Absolute(2))",
                                      v2.Width.ToString ()
                    #else
                        Assert.Equal (
-                                     "Combine(View(Width,FrameView()(49,0,49,5))-Absolute(2))",
+                                     $"Combine(View(Width,FrameView(){f2.Frame})-Absolute(2))",
                                      v2.Width.ToString ()
                    #endif
                                     );
@@ -667,7 +667,7 @@ public class DimTests
                        Assert.Equal (50, v4.Frame.Width);
                        Assert.Equal (50, v4.Frame.Height);
                    #if DEBUG
-                       Assert.Equal ("Combine(View(Width,Button(v1)(2,7,47,89))-View(Width,Button(v3)(0,0,9,9)))", v5.Width.ToString ());
+                       Assert.Equal ($"Combine(View(Width,Button(v1){v1.Frame})-View(Width,Button(v3){v3.Bounds}))", v5.Width.ToString ());
                     #else
                        Assert.Equal ("Combine(View(Height,Button()(2,7,47,89))-View(Height,Button()(0,0,9,9)))", v5.Height.ToString ( ));
                    #endif
@@ -703,7 +703,7 @@ public class DimTests
 
                        v1.Text = "Button1";
                    #if DEBUG
-                       Assert.Equal ("Combine(View(Width,FrameView(f1)(0,0,99,5))-Absolute(2))", v1.Width.ToString ());
+                       Assert.Equal ($"Combine(View(Width,FrameView(f1){f1.Frame})-Absolute(2))", v1.Width.ToString ());
                    #else
                        Assert.Equal ("Combine(View(Width,FrameView()(0,0,99,5))-Absolute(2))", v1.Width.ToString ());
                    #endif
@@ -714,7 +714,7 @@ public class DimTests
                        v2.Text = "Button2";
 
                    #if DEBUG
-                   Assert.Equal ( "Combine(View(Width,FrameView(f2)(99,0,99,5))-Absolute(2))", v2.Width.ToString ());
+                   Assert.Equal ( $"Combine(View(Width,FrameView(f2){f2.Frame})-Absolute(2))", v2.Width.ToString ());
                    #else
                        Assert.Equal ( "Combine(View(Width,FrameView()(99,0,99,5))-Absolute(2))", v2.Width.ToString ());
                    #endif
@@ -746,8 +746,8 @@ public class DimTests
                        v5.Text = "Button5";
 
                    #if DEBUG
-                       Assert.Equal ("Combine(View(Width,Button(v1)(2,7,97,189))-View(Width,Button(v3)(0,0,19,19)))", v5.Width.ToString ());
-                       Assert.Equal ("Combine(View(Height,Button(v1)(2,7,97,189))-View(Height,Button(v3)(0,0,19,19)))", v5.Height.ToString ());
+                       Assert.Equal ($"Combine(View(Width,Button(v1){v1.Frame})-View(Width,Button(v3){v3.Frame}))", v5.Width.ToString ());
+                       Assert.Equal ($"Combine(View(Height,Button(v1){v1.Frame})-View(Height,Button(v3){v3.Frame}))", v5.Height.ToString ());
                    #else
                        Assert.Equal ("Combine(View(Width,Button()(2,7,97,189))-View(Width,Button()(0,0,19,19)))", v5.Width.ToString ());
                        Assert.Equal ("Combine(View(Height,Button()(2,7,97,189))-View(Height,Button()(0,0,19,19)))", v5.Height.ToString ());
@@ -873,13 +873,13 @@ public class DimTests
     [TestRespondersDisposed]
     public void SetsValue ()
     {
-        var testVal = Rect.Empty;
+        var testVal = Rectangle.Empty;
         var testValView = new View { Frame = testVal };
         Dim dim = Dim.Width (testValView);
         Assert.Equal ($"View(Width,View(){testVal})", dim.ToString ());
         testValView.Dispose ();
 
-        testVal = new Rect (1, 2, 3, 4);
+        testVal = new Rectangle (1, 2, 3, 4);
         testValView = new View { Frame = testVal };
         dim = Dim.Width (testValView);
         Assert.Equal ($"View(Width,View(){testVal})", dim.ToString ());
@@ -931,9 +931,9 @@ public class DimTests
     [TestRespondersDisposed]
     public void Width_Equals ()
     {
-        var testRect1 = Rect.Empty;
+        var testRect1 = Rectangle.Empty;
         var view1 = new View { Frame = testRect1 };
-        var testRect2 = Rect.Empty;
+        var testRect2 = Rectangle.Empty;
         var view2 = new View { Frame = testRect2 };
 
         Dim dim1 = Dim.Width (view1);
@@ -945,27 +945,27 @@ public class DimTests
         dim2 = Dim.Width (view2);
         Assert.NotEqual (dim1, dim2);
 
-        testRect1 = new Rect (0, 1, 2, 3);
+        testRect1 = new Rectangle (0, 1, 2, 3);
         view1 = new View { Frame = testRect1 };
-        testRect2 = new Rect (0, 1, 2, 3);
+        testRect2 = new Rectangle (0, 1, 2, 3);
         dim1 = Dim.Width (view1);
         dim2 = Dim.Width (view1);
 
         // FIXED: Dim.Width should support Equals() and this should change to Equal.
         Assert.Equal (dim1, dim2);
 
-        testRect1 = new Rect (0, -1, 2, 3);
+        testRect1 = new Rectangle (0, -1, 2, 3);
         view1 = new View { Frame = testRect1 };
-        testRect2 = new Rect (0, -1, 2, 3);
+        testRect2 = new Rectangle (0, -1, 2, 3);
         dim1 = Dim.Width (view1);
         dim2 = Dim.Width (view1);
 
         // FIXED: Dim.Width should support Equals() and this should change to Equal.
         Assert.Equal (dim1, dim2);
 
-        testRect1 = new Rect (0, -1, 2, 3);
+        testRect1 = new Rectangle (0, -1, 2, 3);
         view1 = new View { Frame = testRect1 };
-        testRect2 = Rect.Empty;
+        testRect2 = Rectangle.Empty;
         view2 = new View { Frame = testRect2 };
         dim1 = Dim.Width (view1);
         dim2 = Dim.Width (view2);

+ 17 - 17
UnitTests/View/Layout/LayoutTests.cs

@@ -190,7 +190,7 @@ public class LayoutTests
         switch (width)
         {
             case 1:
-                Assert.Equal (new Rect (0, 0, 0, 4), subview.Frame);
+                Assert.Equal (new Rectangle (0, 0, 0, 4), subview.Frame);
 
                 expected = @"
@@ -203,7 +203,7 @@ public class LayoutTests
 
                 break;
             case 2:
-                Assert.Equal (new Rect (0, 0, 0, 4), subview.Frame);
+                Assert.Equal (new Rectangle (0, 0, 0, 4), subview.Frame);
 
                 expected = @"
 ┌┐
@@ -216,7 +216,7 @@ public class LayoutTests
 
                 break;
             case 3:
-                Assert.Equal (new Rect (0, 0, 0, 4), subview.Frame);
+                Assert.Equal (new Rectangle (0, 0, 0, 4), subview.Frame);
 
                 expected = @"
 ┌─┐
@@ -229,7 +229,7 @@ public class LayoutTests
 
                 break;
             case 4:
-                Assert.Equal (new Rect (0, 0, 1, 4), subview.Frame);
+                Assert.Equal (new Rectangle (0, 0, 1, 4), subview.Frame);
 
                 expected = @"
 ┌──┐
@@ -242,7 +242,7 @@ public class LayoutTests
 
                 break;
             case 5:
-                Assert.Equal (new Rect (0, 0, 2, 4), subview.Frame);
+                Assert.Equal (new Rectangle (0, 0, 2, 4), subview.Frame);
 
                 expected = @"
 ┌───┐
@@ -255,7 +255,7 @@ public class LayoutTests
 
                 break;
             case 6:
-                Assert.Equal (new Rect (0, 0, 3, 4), subview.Frame);
+                Assert.Equal (new Rectangle (0, 0, 3, 4), subview.Frame);
 
                 expected = @"
 ┌────┐
@@ -268,7 +268,7 @@ public class LayoutTests
 
                 break;
             case 7:
-                Assert.Equal (new Rect (0, 0, 4, 4), subview.Frame);
+                Assert.Equal (new Rectangle (0, 0, 4, 4), subview.Frame);
 
                 expected = @"
 ┌─────┐
@@ -281,7 +281,7 @@ public class LayoutTests
 
                 break;
             case 8:
-                Assert.Equal (new Rect (0, 0, 5, 4), subview.Frame);
+                Assert.Equal (new Rectangle (0, 0, 5, 4), subview.Frame);
 
                 expected = @"
 ┌──────┐
@@ -294,7 +294,7 @@ public class LayoutTests
 
                 break;
             case 9:
-                Assert.Equal (new Rect (1, 0, 5, 4), subview.Frame);
+                Assert.Equal (new Rectangle (1, 0, 5, 4), subview.Frame);
 
                 expected = @"
 ┌───────┐
@@ -307,7 +307,7 @@ public class LayoutTests
 
                 break;
             case 10:
-                Assert.Equal (new Rect (1, 0, 6, 4), subview.Frame);
+                Assert.Equal (new Rectangle (1, 0, 6, 4), subview.Frame);
 
                 expected = @"
 ┌────────┐
@@ -498,7 +498,7 @@ public class LayoutTests
 
         t.Ready += (s, e) =>
                    {
-                       v.Frame = new Rect (2, 2, 10, 10);
+                       v.Frame = new Rectangle (2, 2, 10, 10);
                        Assert.Equal (2, v.X = 2);
                        Assert.Equal (2, v.Y = 2);
                    };
@@ -543,12 +543,12 @@ public class LayoutTests
 └──────────────────┘",
                                                       _output
                                                      );
-        Assert.Equal (new Rect (0, 0, 80, 25), top.Frame);
-        Assert.Equal (new Rect (0, 0, 5, 1), view1.Frame);
-        Assert.Equal (new Rect (0, 0, 20, 10), win1.Frame);
-        Assert.Equal (new Rect (0, 2, 10, 3), win2.Frame);
-        Assert.Equal (new Rect (0, 0, 8, 1), view2.Frame);
-        Assert.Equal (new Rect (0, 0, 7, 1), view3.Frame);
+        Assert.Equal (new Rectangle (0, 0, 80, 25), top.Frame);
+        Assert.Equal (new Rectangle (0, 0, 5, 1), view1.Frame);
+        Assert.Equal (new Rectangle (0, 0, 20, 10), win1.Frame);
+        Assert.Equal (new Rectangle (0, 2, 10, 3), win2.Frame);
+        Assert.Equal (new Rectangle (0, 0, 8, 1), view2.Frame);
+        Assert.Equal (new Rectangle (0, 0, 7, 1), view3.Frame);
         var foundView = View.FindDeepestView (top, 9, 4, out int rx, out int ry);
         Assert.Equal (foundView, view2);
 

+ 29 - 29
UnitTests/View/Layout/PosTests.cs

@@ -47,9 +47,9 @@ public class PosTests
         top.Add (win);
         RunState rs = Application.Begin (top);
 
-        Assert.Equal (new Rect (0, 0, 80, 25), top.Frame);
-        Assert.Equal (new Rect (0, 0, 80, 25), win.Frame);
-        Assert.Equal (new Rect (68, 22, 10, 1), tv.Frame);
+        Assert.Equal (new Rectangle (0, 0, 80, 25), top.Frame);
+        Assert.Equal (new Rectangle (0, 0, 80, 25), win.Frame);
+        Assert.Equal (new Rectangle (68, 22, 10, 1), tv.Frame);
         Application.End (rs);
     }
 
@@ -77,11 +77,11 @@ public class PosTests
         top.Add (win, menu, status);
         RunState rs = Application.Begin (top);
 
-        Assert.Equal (new Rect (0, 0, 80, 25), top.Frame);
-        Assert.Equal (new Rect (0, 0, 80, 1), menu.Frame);
-        Assert.Equal (new Rect (0, 24, 80, 1), status.Frame);
-        Assert.Equal (new Rect (0, 1, 80, 23), win.Frame);
-        Assert.Equal (new Rect (68, 20, 10, 1), tv.Frame);
+        Assert.Equal (new Rectangle (0, 0, 80, 25), top.Frame);
+        Assert.Equal (new Rectangle (0, 0, 80, 1), menu.Frame);
+        Assert.Equal (new Rectangle (0, 24, 80, 1), status.Frame);
+        Assert.Equal (new Rectangle (0, 1, 80, 23), win.Frame);
+        Assert.Equal (new Rectangle (68, 20, 10, 1), tv.Frame);
 
         Application.End (rs);
     }
@@ -201,42 +201,42 @@ public class PosTests
         Pos pos = Pos.Left (v);
 
         Assert.Equal (
-                      "View(side=x,target=View(V)(0,0,0,0))",
+                      $"View(side=x,target=View(V){v.Frame})",
                       pos.ToString ()
                      );
 
         pos = Pos.X (v);
 
         Assert.Equal (
-                      "View(side=x,target=View(V)(0,0,0,0))",
+                      $"View(side=x,target=View(V){v.Frame})",
                       pos.ToString ()
                      );
 
         pos = Pos.Top (v);
 
         Assert.Equal (
-                      "View(side=y,target=View(V)(0,0,0,0))",
+                      $"View(side=y,target=View(V){v.Frame})",
                       pos.ToString ()
                      );
 
         pos = Pos.Y (v);
 
         Assert.Equal (
-                      "View(side=y,target=View(V)(0,0,0,0))",
+                      $"View(side=y,target=View(V){v.Frame})",
                       pos.ToString ()
                      );
 
         pos = Pos.Right (v);
 
         Assert.Equal (
-                      "View(side=right,target=View(V)(0,0,0,0))",
+                      $"View(side=right,target=View(V){v.Frame})",
                       pos.ToString ()
                      );
 
         pos = Pos.Bottom (v);
 
         Assert.Equal (
-                      "View(side=bottom,target=View(V)(0,0,0,0))",
+                      $"View(side=bottom,target=View(V){v.Frame})",
                       pos.ToString ()
                      );
     }
@@ -296,7 +296,7 @@ public class PosTests
         Assert.Equal (posCombine._right, posFactor);
         Assert.Equal (20, posCombine.Anchor (100));
 
-        var view = new View { Frame = new Rect (20, 10, 20, 1) };
+        var view = new View { Frame = new Rectangle (20, 10, 20, 1) };
         var posViewX = new Pos.PosView (view, 0);
         Assert.Equal (20, posViewX.Anchor (0));
         var posViewY = new Pos.PosView (view, 1);
@@ -622,9 +622,9 @@ public class PosTests
 
         Exception exception = Record.Exception (super.LayoutSubviews);
         Assert.Null (exception);
-        Assert.Equal (new Rect (0, 0, 10, 10), super.Frame);
-        Assert.Equal (new Rect (0, 0, 2, 2), view1.Frame);
-        Assert.Equal (new Rect (8, 0, 2, 2), view2.Frame);
+        Assert.Equal (new Rectangle (0, 0, 10, 10), super.Frame);
+        Assert.Equal (new Rectangle (0, 0, 2, 2), view1.Frame);
+        Assert.Equal (new Rectangle (8, 0, 2, 2), view2.Frame);
 
         super.Dispose ();
     }
@@ -702,21 +702,21 @@ public class PosTests
     public void PosSide_SetsValue ()
     {
         string side; // used in format string
-        var testRect = Rect.Empty;
+        var testRect = Rectangle.Empty;
         var testInt = 0;
         Pos pos;
 
         // Pos.Left
         side = "x";
         testInt = 0;
-        testRect = Rect.Empty;
+        testRect = Rectangle.Empty;
         pos = Pos.Left (new View ());
         Assert.Equal ($"View(side={side},target=View(){testRect})", pos.ToString ());
 
         pos = Pos.Left (new View { Frame = testRect });
         Assert.Equal ($"View(side={side},target=View(){testRect})", pos.ToString ());
 
-        testRect = new Rect (1, 2, 3, 4);
+        testRect = new Rectangle (1, 2, 3, 4);
         pos = Pos.Left (new View { Frame = testRect });
         Assert.Equal ($"View(side={side},target=View(){testRect})", pos.ToString ());
 
@@ -751,14 +751,14 @@ public class PosTests
         // Pos.X
         side = "x";
         testInt = 0;
-        testRect = Rect.Empty;
+        testRect = Rectangle.Empty;
         pos = Pos.X (new View ());
         Assert.Equal ($"View(side={side},target=View(){testRect})", pos.ToString ());
 
         pos = Pos.X (new View { Frame = testRect });
         Assert.Equal ($"View(side={side},target=View(){testRect})", pos.ToString ());
 
-        testRect = new Rect (1, 2, 3, 4);
+        testRect = new Rectangle (1, 2, 3, 4);
         pos = Pos.X (new View { Frame = testRect });
         Assert.Equal ($"View(side={side},target=View(){testRect})", pos.ToString ());
 
@@ -793,14 +793,14 @@ public class PosTests
         // Pos.Top
         side = "y";
         testInt = 0;
-        testRect = Rect.Empty;
+        testRect = Rectangle.Empty;
         pos = Pos.Top (new View ());
         Assert.Equal ($"View(side={side},target=View(){testRect})", pos.ToString ());
 
         pos = Pos.Top (new View { Frame = testRect });
         Assert.Equal ($"View(side={side},target=View(){testRect})", pos.ToString ());
 
-        testRect = new Rect (1, 2, 3, 4);
+        testRect = new Rectangle (1, 2, 3, 4);
         pos = Pos.Top (new View { Frame = testRect });
         Assert.Equal ($"View(side={side},target=View(){testRect})", pos.ToString ());
 
@@ -835,14 +835,14 @@ public class PosTests
         // Pos.Y
         side = "y";
         testInt = 0;
-        testRect = Rect.Empty;
+        testRect = Rectangle.Empty;
         pos = Pos.Y (new View ());
         Assert.Equal ($"View(side={side},target=View(){testRect})", pos.ToString ());
 
         pos = Pos.Y (new View { Frame = testRect });
         Assert.Equal ($"View(side={side},target=View(){testRect})", pos.ToString ());
 
-        testRect = new Rect (1, 2, 3, 4);
+        testRect = new Rectangle (1, 2, 3, 4);
         pos = Pos.Y (new View { Frame = testRect });
         Assert.Equal ($"View(side={side},target=View(){testRect})", pos.ToString ());
 
@@ -876,7 +876,7 @@ public class PosTests
 
         // Pos.Bottom
         side = "bottom";
-        testRect = Rect.Empty;
+        testRect = Rectangle.Empty;
         testInt = 0;
         pos = Pos.Bottom (new View ());
         Assert.Equal ($"View(side={side},target=View(){testRect})", pos.ToString ());
@@ -884,7 +884,7 @@ public class PosTests
         pos = Pos.Bottom (new View { Frame = testRect });
         Assert.Equal ($"View(side={side},target=View(){testRect})", pos.ToString ());
 
-        testRect = new Rect (1, 2, 3, 4);
+        testRect = new Rectangle (1, 2, 3, 4);
         pos = Pos.Bottom (new View { Frame = testRect });
         Assert.Equal ($"View(side={side},target=View(){testRect})", pos.ToString ());
 

+ 10 - 10
UnitTests/View/Layout/SetRelativeLayoutTests.cs

@@ -10,7 +10,7 @@ public class SetRelativeLayoutTests
     [Fact]
     public void AbsolutePosDim_DontChange ()
     {
-        var screen = new Rect (0, 0, 10, 15);
+        var screen = new Rectangle (0, 0, 10, 15);
 
         var view = new View
         {
@@ -31,7 +31,7 @@ public class SetRelativeLayoutTests
     [Fact]
     public void ComputedPosDim_StayComputed ()
     {
-        var screen = new Rect (0, 0, 10, 15);
+        var screen = new Rectangle (0, 0, 10, 15);
         var view = new View { X = 1, Y = 2, Width = Dim.Fill (), Height = Dim.Fill () };
 
         Assert.Equal ("Absolute(1)", view.X.ToString ());
@@ -48,7 +48,7 @@ public class SetRelativeLayoutTests
     {
         var view = new View { X = 1, Y = 1, Width = Dim.Fill (), Height = Dim.Fill () };
 
-        view.SetRelativeLayout (new Rect (0, 0, 80, 25));
+        view.SetRelativeLayout (new Rectangle (0, 0, 80, 25));
         Assert.Equal ("Fill(0)", view.Width.ToString ());
         Assert.Equal (1, view.Frame.X);
         Assert.Equal (1, view.Frame.Y);
@@ -63,7 +63,7 @@ public class SetRelativeLayoutTests
         view.Y = 0;
         Assert.Equal ("Absolute(0)", view.X.ToString ());
         Assert.Equal ("Fill(0)", view.Width.ToString ());
-        view.SetRelativeLayout (new Rect (0, 0, 80, 25));
+        view.SetRelativeLayout (new Rectangle (0, 0, 80, 25));
         Assert.Equal (0, view.Frame.X);
         Assert.Equal (0, view.Frame.Y);
         Assert.Equal (80, view.Frame.Width);
@@ -77,7 +77,7 @@ public class SetRelativeLayoutTests
     [Fact]
     public void Fill_And_PosCenter ()
     {
-        var screen = new Rect (0, 0, 80, 25);
+        var screen = new Rectangle (0, 0, 80, 25);
         var view = new View { X = Pos.Center (), Y = Pos.Center (), Width = Dim.Fill (), Height = Dim.Fill () };
 
         view.SetRelativeLayout (screen);
@@ -139,7 +139,7 @@ public class SetRelativeLayoutTests
     [Fact]
     public void Fill_Pos_Outside_Bounds ()
     {
-        var screen = new Rect (0, 0, 80, 25);
+        var screen = new Rectangle (0, 0, 80, 25);
 
         var view = new View
         {
@@ -187,7 +187,7 @@ public class SetRelativeLayoutTests
     [Fact]
     public void Fill_Pos_Within_Bounds ()
     {
-        var screen = new Rect (0, 0, 80, 25);
+        var screen = new Rectangle (0, 0, 80, 25);
         var view = new View { X = 1, Y = 1, Width = 5, Height = 4 };
 
         view.SetRelativeLayout (screen);
@@ -351,7 +351,7 @@ public class SetRelativeLayoutTests
         // SetRelativeLayout. In addition, the old test was bogus because it was testing the wrong thing (and 
         // because in v1 Pos.Center was broken in this regard!
 
-        var screen = new Rect (0, 0, 80, 25);
+        var screen = new Rectangle (0, 0, 80, 25);
 
         var view = new View
         {
@@ -385,7 +385,7 @@ public class SetRelativeLayoutTests
     [Fact]
     public void PosCombine_PosCenter_Plus_Absolute ()
     {
-        var screen = new Rect (0, 0, 80, 25);
+        var screen = new Rectangle (0, 0, 80, 25);
 
         var view = new View
         {
@@ -403,7 +403,7 @@ public class SetRelativeLayoutTests
     [Fact]
     public void PosDimFunction ()
     {
-        var screen = new Rect (0, 0, 30, 1);
+        var screen = new Rectangle (0, 0, 30, 1);
         var view = new View { Text = "abc", AutoSize = true }; // BUGBUG: AutoSize or Width must be set
         view.X = Pos.AnchorEnd () - Pos.Function (GetViewWidth);
 

+ 13 - 13
UnitTests/View/NavigationTests.cs

@@ -816,13 +816,13 @@ public class NavigationTests
         Application.Begin (top);
 
         Assert.Equal (Application.Current, top);
-        Assert.Equal (new Rect (0, 0, 80, 25), new Rect (0, 0, View.Driver.Cols, View.Driver.Rows));
-        Assert.Equal (new Rect (0, 0, View.Driver.Cols, View.Driver.Rows), top.Frame);
-        Assert.Equal (new Rect (0, 0, 80, 25), top.Frame);
+        Assert.Equal (new Rectangle (0, 0, 80, 25), new Rectangle (0, 0, View.Driver.Cols, View.Driver.Rows));
+        Assert.Equal (new Rectangle (0, 0, View.Driver.Cols, View.Driver.Rows), top.Frame);
+        Assert.Equal (new Rectangle (0, 0, 80, 25), top.Frame);
 
         ((FakeDriver)Application.Driver).SetBufferSize (20, 10);
-        Assert.Equal (new Rect (0, 0, View.Driver.Cols, View.Driver.Rows), top.Frame);
-        Assert.Equal (new Rect (0, 0, 20, 10), top.Frame);
+        Assert.Equal (new Rectangle (0, 0, View.Driver.Cols, View.Driver.Rows), top.Frame);
+        Assert.Equal (new Rectangle (0, 0, 20, 10), top.Frame);
 
         _ = TestHelpers.AssertDriverContentsWithFrameAre (
                                                           @"
@@ -959,16 +959,16 @@ public class NavigationTests
         Application.Begin (top);
 
         Assert.Equal (Application.Current, top);
-        Assert.Equal (new Rect (0, 0, 80, 25), new Rect (0, 0, View.Driver.Cols, View.Driver.Rows));
-        Assert.NotEqual (new Rect (0, 0, View.Driver.Cols, View.Driver.Rows), top.Frame);
-        Assert.Equal (new Rect (3, 2, 20, 10), top.Frame);
+        Assert.Equal (new Rectangle (0, 0, 80, 25), new Rectangle (0, 0, View.Driver.Cols, View.Driver.Rows));
+        Assert.NotEqual (new Rectangle (0, 0, View.Driver.Cols, View.Driver.Rows), top.Frame);
+        Assert.Equal (new Rectangle (3, 2, 20, 10), top.Frame);
 
         ((FakeDriver)Application.Driver).SetBufferSize (30, 20);
-        Assert.Equal (new Rect (0, 0, 30, 20), new Rect (0, 0, View.Driver.Cols, View.Driver.Rows));
-        Assert.NotEqual (new Rect (0, 0, View.Driver.Cols, View.Driver.Rows), top.Frame);
-        Assert.Equal (new Rect (3, 2, 20, 10), top.Frame);
+        Assert.Equal (new Rectangle (0, 0, 30, 20), new Rectangle (0, 0, View.Driver.Cols, View.Driver.Rows));
+        Assert.NotEqual (new Rectangle (0, 0, View.Driver.Cols, View.Driver.Rows), top.Frame);
+        Assert.Equal (new Rectangle (3, 2, 20, 10), top.Frame);
 
-        Rect frame = TestHelpers.AssertDriverContentsWithFrameAre (
+        Rectangle frame = TestHelpers.AssertDriverContentsWithFrameAre (
                                                                    @"
    ┌──────────────────┐
    │                  │
@@ -985,7 +985,7 @@ public class NavigationTests
 
         // mean the output started at col 3 and line 2
         // which result with a width of 23 and a height of 10 on the output
-        Assert.Equal (new Rect (3, 2, 23, 10), frame);
+        Assert.Equal (new Rectangle (3, 2, 23, 10), frame);
 
         // top
         Assert.Equal (new Point (-3, -2), top.ScreenToFrame (0, 0));

+ 1 - 1
UnitTests/View/SubviewTests.cs

@@ -12,7 +12,7 @@ public class SubviewTests
     [TestRespondersDisposed]
     public void Added_Removed ()
     {
-        var v = new View { Frame = new Rect (0, 0, 10, 24) };
+        var v = new View { Frame = new Rectangle (0, 0, 10, 24) };
         var t = new View ();
 
         v.Added += (s, e) =>

+ 30 - 28
UnitTests/View/Text/AutoSizeFalseTests.cs

@@ -50,27 +50,27 @@ public class AutoSizeFalseTests
         Assert.False (view4.IsInitialized);
         Assert.False (view5.IsInitialized);
         Assert.False (view1.AutoSize);
-        Assert.Equal (new Rect (0, 0, 10, 5), view1.Frame);
+        Assert.Equal (new Rectangle (0, 0, 10, 5), view1.Frame);
         Assert.Equal ("Absolute(10)", view1.Width.ToString ());
         Assert.Equal ("Absolute(5)", view1.Height.ToString ());
         Assert.False (view2.AutoSize);
-        Assert.Equal (new Rect (0, 0, 10, 5), view2.Frame);
+        Assert.Equal (new Rectangle (0, 0, 10, 5), view2.Frame);
         Assert.Equal ("Absolute(10)", view2.Width.ToString ());
         Assert.Equal ("Absolute(5)", view2.Height.ToString ());
         Assert.False (view3.AutoSize);
-        Assert.Equal (new Rect (0, 0, 10, 5), view3.Frame);
+        Assert.Equal (new Rectangle (0, 0, 10, 5), view3.Frame);
         Assert.Equal ("Absolute(10)", view3.Width.ToString ());
         Assert.Equal ("Absolute(5)", view3.Height.ToString ());
         Assert.False (view4.AutoSize);
-        Assert.Equal (new Rect (0, 0, 10, 5), view4.Frame);
+        Assert.Equal (new Rectangle (0, 0, 10, 5), view4.Frame);
         Assert.Equal ("Absolute(10)", view4.Width.ToString ());
         Assert.Equal ("Absolute(5)", view4.Height.ToString ());
         Assert.False (view5.AutoSize);
-        Assert.Equal (new Rect (0, 0, 10, 5), view5.Frame);
+        Assert.Equal (new Rectangle (0, 0, 10, 5), view5.Frame);
         Assert.Equal ("Absolute(10)", view5.Width.ToString ());
         Assert.Equal ("Absolute(5)", view5.Height.ToString ());
         Assert.False (view6.AutoSize);
-        Assert.Equal (new Rect (0, 0, 10, 5), view6.Frame);
+        Assert.Equal (new Rectangle (0, 0, 10, 5), view6.Frame);
         Assert.Equal ("Absolute(10)", view6.Width.ToString ());
         Assert.Equal ("Absolute(5)", view6.Height.ToString ());
 
@@ -83,27 +83,27 @@ public class AutoSizeFalseTests
         Assert.True (view4.IsInitialized);
         Assert.True (view5.IsInitialized);
         Assert.False (view1.AutoSize);
-        Assert.Equal (new Rect (0, 0, 10, 5), view1.Frame);
+        Assert.Equal (new Rectangle (0, 0, 10, 5), view1.Frame);
         Assert.Equal ("Absolute(10)", view1.Width.ToString ());
         Assert.Equal ("Absolute(5)", view1.Height.ToString ());
         Assert.False (view2.AutoSize);
-        Assert.Equal (new Rect (0, 0, 10, 5), view2.Frame);
+        Assert.Equal (new Rectangle (0, 0, 10, 5), view2.Frame);
         Assert.Equal ("Absolute(10)", view2.Width.ToString ());
         Assert.Equal ("Absolute(5)", view2.Height.ToString ());
         Assert.False (view3.AutoSize);
-        Assert.Equal (new Rect (0, 0, 10, 5), view3.Frame);
+        Assert.Equal (new Rectangle (0, 0, 10, 5), view3.Frame);
         Assert.Equal ("Absolute(10)", view3.Width.ToString ());
         Assert.Equal ("Absolute(5)", view3.Height.ToString ());
         Assert.False (view4.AutoSize);
-        Assert.Equal (new Rect (0, 0, 10, 5), view4.Frame);
+        Assert.Equal (new Rectangle (0, 0, 10, 5), view4.Frame);
         Assert.Equal ("Absolute(10)", view4.Width.ToString ());
         Assert.Equal ("Absolute(5)", view4.Height.ToString ());
         Assert.False (view5.AutoSize);
-        Assert.Equal (new Rect (0, 0, 10, 5), view5.Frame);
+        Assert.Equal (new Rectangle (0, 0, 10, 5), view5.Frame);
         Assert.Equal ("Absolute(10)", view5.Width.ToString ());
         Assert.Equal ("Absolute(5)", view5.Height.ToString ());
         Assert.False (view6.AutoSize);
-        Assert.Equal (new Rect (0, 0, 10, 5), view6.Frame);
+        Assert.Equal (new Rectangle (0, 0, 10, 5), view6.Frame);
         Assert.Equal ("Absolute(10)", view6.Width.ToString ());
         Assert.Equal ("Absolute(5)", view6.Height.ToString ());
     }
@@ -142,25 +142,27 @@ public class AutoSizeFalseTests
 
         view.Text = "New text";
         super.LayoutSubviews ();
+        Rectangle expectedViewBounds = new (0, 0, 0, 0);
 
         Assert.False (view.AutoSize);
-        Assert.Equal ("(0,0,0,0)", view.Bounds.ToString ());
+        Assert.Equal (expectedViewBounds, view.Bounds);
         super.Dispose ();
     }
 
     [Fact]
     public void AutoSize_False_ResizeView_With_Dim_Fill_After_IsInitialized ()
     {
-        var super = new View { Frame = new Rect (0, 0, 30, 80) };
+        var super = new View { Frame = new Rectangle (0, 0, 30, 80) };
         var view = new View { Width = Dim.Fill (), Height = Dim.Fill () };
         super.Add (view);
         Assert.False (view.AutoSize);
 
         view.Text = "New text\nNew line";
         super.LayoutSubviews ();
+        Rectangle expectedViewBounds = new (0, 0, 30, 80);
 
         Assert.False (view.AutoSize);
-        Assert.Equal ("(0,0,30,80)", view.Bounds.ToString ());
+        Assert.Equal (expectedViewBounds, view.Bounds);
         Assert.False (view.IsInitialized);
 
         super.BeginInit ();
@@ -168,7 +170,7 @@ public class AutoSizeFalseTests
 
         Assert.True (view.IsInitialized);
         Assert.False (view.AutoSize);
-        Assert.Equal ("(0,0,30,80)", view.Bounds.ToString ());
+        Assert.Equal (expectedViewBounds, view.Bounds);
     }
 
     [Fact]
@@ -214,8 +216,8 @@ public class AutoSizeFalseTests
     {
         var view = new View { Width = Dim.Fill (), Height = Dim.Fill () };
 
-        view.SetRelativeLayout (new Rect (0, 0, 10, 4));
-        Assert.Equal (new Rect (0, 0, 10, 4), view.Frame);
+        view.SetRelativeLayout (new Rectangle (0, 0, 10, 4));
+        Assert.Equal (new Rectangle (0, 0, 10, 4), view.Frame);
         Assert.Equal (new Size (0, 0), view.TextFormatter.Size);
         Assert.False (view.AutoSize);
         Assert.True (view.TextFormatter.NeedsFormat);
@@ -249,10 +251,10 @@ public class AutoSizeFalseTests
 
         Assert.Equal (5, text.Length);
         Assert.False (view.AutoSize);
-        Assert.Equal (new Rect (0, 0, 3, 1), view.Frame);
+        Assert.Equal (new Rectangle (0, 0, 3, 1), view.Frame);
         Assert.Equal (new Size (3, 1), view.TextFormatter.Size);
         Assert.Equal (new List<string> { "Vie" }, view.TextFormatter.GetLines ());
-        Assert.Equal (new Rect (0, 0, 10, 4), frame.Frame);
+        Assert.Equal (new Rectangle (0, 0, 10, 4), frame.Frame);
 
         frame.LayoutSubviews ();
         frame.Clear ();
@@ -265,8 +267,8 @@ public class AutoSizeFalseTests
 └────────┘
 ";
 
-        Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (0, 0, 10, 4), pos);
+        Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
+        Assert.Equal (new Rectangle (0, 0, 10, 4), pos);
 
         text = "0123456789";
         Assert.Equal (10, text.Length);
@@ -276,7 +278,7 @@ public class AutoSizeFalseTests
         frame.Clear ();
         frame.Draw ();
 
-        Assert.Equal (new Rect (0, 0, 0, 1), view.Frame);
+        Assert.Equal (new Rectangle (0, 0, 0, 1), view.Frame);
         Assert.Equal (new Size (0, 1), view.TextFormatter.Size);
         Assert.Equal (new List<string> { string.Empty }, view.TextFormatter.GetLines ());
 
@@ -288,7 +290,7 @@ public class AutoSizeFalseTests
 ";
 
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (0, 0, 10, 4), pos);
+        Assert.Equal (new Rectangle (0, 0, 10, 4), pos);
     }
 
     [Fact]
@@ -324,8 +326,8 @@ public class AutoSizeFalseTests
 
         Assert.False (horizontalView.AutoSize);
         Assert.False (verticalView.AutoSize);
-        Assert.Equal (new Rect (0, 0, 20, 1), horizontalView.Frame);
-        Assert.Equal (new Rect (0, 3, 1, 20), verticalView.Frame);
+        Assert.Equal (new Rectangle (0, 0, 20, 1), horizontalView.Frame);
+        Assert.Equal (new Rectangle (0, 3, 1, 20), verticalView.Frame);
 
         top.Draw ();
 
@@ -364,7 +366,7 @@ public class AutoSizeFalseTests
 └──────────────────────────────┘
 ";
 
-        Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
+        Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
 
         verticalView.Text = $"最初の行{Environment.NewLine}二行目";
         Assert.True (verticalView.TextFormatter.NeedsFormat);
@@ -376,7 +378,7 @@ public class AutoSizeFalseTests
         Assert.True (verticalView.TextFormatter.NeedsFormat);
 
         top.Draw ();
-        Assert.Equal (new Rect (0, 3, 2, 20), verticalView.Frame);
+        Assert.Equal (new Rectangle (0, 3, 2, 20), verticalView.Frame);
 
         expected = @"
 ┌──────────────────────────────┐

+ 141 - 135
UnitTests/View/Text/AutoSizeTrueTests.cs

@@ -1,4 +1,4 @@
-using System.Text;
+using System.Text;
 using Xunit.Abstractions;
 
 namespace Terminal.Gui.ViewTests;
@@ -355,9 +355,9 @@ public class AutoSizeTrueTests
 
         Assert.True (label.AutoSize);
         Assert.Equal (29, label.Text.Length);
-        Assert.Equal (new Rect (0, 0, 40, 10), top.Frame);
-        Assert.Equal (new Rect (0, 0, 40, 10), win.Frame);
-        Assert.Equal (new Rect (0, 7, 29, 1), label.Frame);
+        Assert.Equal (new Rectangle (0, 0, 40, 10), top.Frame);
+        Assert.Equal (new Rectangle (0, 0, 40, 10), win.Frame);
+        Assert.Equal (new Rectangle (0, 7, 29, 1), label.Frame);
 
         var expected = @"
 ┌──────────────────────────────────────┐
@@ -402,11 +402,11 @@ public class AutoSizeTrueTests
         RunState rs = Application.Begin (top);
 
         Assert.True (label.AutoSize);
-        Assert.Equal (new Rect (0, 0, 80, 25), top.Frame);
-        Assert.Equal (new Rect (0, 0, 80, 1), menu.Frame);
-        Assert.Equal (new Rect (0, 24, 80, 1), status.Frame);
-        Assert.Equal (new Rect (0, 1, 80, 23), win.Frame);
-        Assert.Equal (new Rect (0, 20, 29, 1), label.Frame);
+        Assert.Equal (new Rectangle (0, 0, 80, 25), top.Frame);
+        Assert.Equal (new Rectangle (0, 0, 80, 1), menu.Frame);
+        Assert.Equal (new Rectangle (0, 24, 80, 1), status.Frame);
+        Assert.Equal (new Rectangle (0, 1, 80, 23), win.Frame);
+        Assert.Equal (new Rectangle (0, 20, 29, 1), label.Frame);
 
         var expected = @"
  Menu                                                                           
@@ -466,9 +466,9 @@ public class AutoSizeTrueTests
         ((FakeDriver)Application.Driver).SetBufferSize (40, 10);
 
         Assert.True (label.AutoSize);
-        Assert.Equal (new Rect (0, 0, 40, 10), top.Frame);
-        Assert.Equal (new Rect (0, 0, 40, 10), win.Frame);
-        Assert.Equal (new Rect (0, 7, 29, 1), label.Frame);
+        Assert.Equal (new Rectangle (0, 0, 40, 10), top.Frame);
+        Assert.Equal (new Rectangle (0, 0, 40, 10), win.Frame);
+        Assert.Equal (new Rectangle (0, 7, 29, 1), label.Frame);
 
         var expected = @"
 ┌──────────────────────────────────────┐
@@ -514,11 +514,11 @@ public class AutoSizeTrueTests
         RunState rs = Application.Begin (top);
 
         Assert.True (label.AutoSize);
-        Assert.Equal (new Rect (0, 0, 80, 25), top.Frame);
-        Assert.Equal (new Rect (0, 0, 80, 1), menu.Frame);
-        Assert.Equal (new Rect (0, 24, 80, 1), status.Frame);
-        Assert.Equal (new Rect (0, 1, 80, 23), win.Frame);
-        Assert.Equal (new Rect (0, 20, 29, 1), label.Frame);
+        Assert.Equal (new Rectangle (0, 0, 80, 25), top.Frame);
+        Assert.Equal (new Rectangle (0, 0, 80, 1), menu.Frame);
+        Assert.Equal (new Rectangle (0, 24, 80, 1), status.Frame);
+        Assert.Equal (new Rectangle (0, 1, 80, 23), win.Frame);
+        Assert.Equal (new Rectangle (0, 20, 29, 1), label.Frame);
 
         var expected = @"
  Menu                                                                           
@@ -577,8 +577,8 @@ public class AutoSizeTrueTests
                              if (k.KeyCode == KeyCode.Enter)
                              {
                                  ((FakeDriver)Application.Driver).SetBufferSize (22, count + 4);
-                                 Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expecteds [count], _output);
-                                 Assert.Equal (new Rect (0, 0, 22, count + 4), pos);
+                                 Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expecteds [count], _output);
+                                 Assert.Equal (new Rectangle (0, 0, 22, count + 4), pos);
 
                                  if (count < 20)
                                  {
@@ -683,8 +683,8 @@ public class AutoSizeTrueTests
                              if (k.KeyCode == KeyCode.Enter)
                              {
                                  ((FakeDriver)Application.Driver).SetBufferSize (22, count + 4);
-                                 Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expecteds [count], _output);
-                                 Assert.Equal (new Rect (0, 0, 22, count + 4), pos);
+                                 Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expecteds [count], _output);
+                                 Assert.Equal (new Rectangle (0, 0, 22, count + 4), pos);
 
                                  if (count > 0)
                                  {
@@ -814,10 +814,10 @@ public class AutoSizeTrueTests
 
         Assert.Equal (5, text.Length);
         Assert.False (label.AutoSize);
-        Assert.Equal (new Rect (0, 0, 3, 0), label.Frame);
+        Assert.Equal (new Rectangle (0, 0, 3, 0), label.Frame);
         Assert.Equal (new Size (3, 0), label.TextFormatter.Size);
         Assert.Single (label.TextFormatter.GetLines ());
-        Assert.Equal (new Rect (0, 0, 10, 4), win.Frame);
+        Assert.Equal (new Rectangle (0, 0, 10, 4), win.Frame);
 
         var expected = @"
 ┌────────┐
@@ -826,8 +826,8 @@ public class AutoSizeTrueTests
 └────────┘
 ";
 
-        Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (0, 0, 10, 4), pos);
+        Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
+        Assert.Equal (new Rectangle (0, 0, 10, 4), pos);
 
         text = "0123456789";
         Assert.Equal (10, text.Length);
@@ -836,7 +836,7 @@ public class AutoSizeTrueTests
         win.Clear ();
         win.Draw ();
 
-        Assert.Equal (new Rect (0, 0, 0, 0), label.Frame);
+        Assert.Equal (new Rectangle (0, 0, 0, 0), label.Frame);
         Assert.Equal (new Size (0, 0), label.TextFormatter.Size);
 
         Exception exception = Record.Exception (
@@ -855,27 +855,29 @@ public class AutoSizeTrueTests
 ";
 
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (0, 0, 10, 4), pos);
+        Assert.Equal (new Rectangle (0, 0, 10, 4), pos);
     }
 
     [Fact]
     public void AutoSize_False_SetWidthHeight_With_Dim_Fill_And_Dim_Absolute_With_Initialization ()
     {
-        var win = new Window { Frame = new Rect (0, 0, 30, 80) };
+        var win = new Window { Frame = new Rectangle (0, 0, 30, 80) };
         var label = new Label ();
         win.Add (label);
         win.BeginInit ();
         win.EndInit ();
 
         Assert.True (label.AutoSize);
-        Assert.Equal ("(0,0,0,0)", label.Bounds.ToString ());
+        Rectangle expectedLabelBounds = Rectangle.Empty;
+        Assert.Equal (expectedLabelBounds, label.Bounds);
         Assert.True (label.AutoSize);
 
         label.Text = "First line\nSecond line";
         win.LayoutSubviews ();
 
+        expectedLabelBounds = new (0, 0, 11, 2);
         Assert.True (label.AutoSize);
-        Assert.Equal ("(0,0,11,2)", label.Bounds.ToString ());
+        Assert.Equal (expectedLabelBounds, label.Bounds);
 
         label.AutoSize = false;
         label.Width = Dim.Fill ();
@@ -885,17 +887,19 @@ public class AutoSizeTrueTests
         // Here the SetMinWidthHeight ensuring the minimum height
         // #3127: After: (0,0,28,2) because turning off AutoSize leaves
         // Height set to 2.
+        expectedLabelBounds = new (0, 0, 28, 2);
         Assert.False (label.AutoSize);
-        Assert.Equal ("(0,0,28,2)", label.Bounds.ToString ());
+        Assert.Equal (expectedLabelBounds, label.Bounds);
 
         label.Text = "First changed line\nSecond changed line\nNew line";
         win.LayoutSubviews ();
 
         // Here the AutoSize is false and the width 28 (Dim.Fill) and
         // #3127: Before: height 1 because it wasn't set and SetMinWidthHeight ensuring the minimum height
-        // #3127: After: (0,0,28,2) because setting Text leaves Height set to 2..
+        // #3127: After: (0,0,28,2) because setting Text leaves Height set to 2.
+        expectedLabelBounds = new (0, 0, 28, 2);
         Assert.False (label.AutoSize);
-        Assert.Equal ("(0,0,28,2)", label.Bounds.ToString ());
+        Assert.Equal (expectedLabelBounds, label.Bounds);
 
         label.AutoSize = true;
 
@@ -903,8 +907,9 @@ public class AutoSizeTrueTests
 
         // Here the AutoSize ensuring the right size with width 19 (width of longest line)
         // and height 3 because the text has 3 lines
+        expectedLabelBounds = new (0, 0, 19, 3);
         Assert.True (label.AutoSize);
-        Assert.Equal ("(0,0,19,3)", label.Bounds.ToString ());
+        Assert.Equal (expectedLabelBounds, label.Bounds);
     }
 
     [Fact]
@@ -1124,10 +1129,10 @@ public class AutoSizeTrueTests
 
         Assert.Equal (5, text.Length);
         Assert.False (label.AutoSize);
-        Assert.Equal (new Rect (0, 0, 3, 1), label.Frame);
+        Assert.Equal (new Rectangle (0, 0, 3, 1), label.Frame);
         Assert.Equal (new Size (3, 1), label.TextFormatter.Size);
         Assert.Single (label.TextFormatter.GetLines ());
-        Assert.Equal (new Rect (0, 0, 10, 4), win.Frame);
+        Assert.Equal (new Rectangle (0, 0, 10, 4), win.Frame);
 
         var expected = @"
 ┌────────┐
@@ -1136,8 +1141,8 @@ public class AutoSizeTrueTests
 └────────┘
 ";
 
-        Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (0, 0, 10, 4), pos);
+        Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
+        Assert.Equal (new Rectangle (0, 0, 10, 4), pos);
 
         text = "0123456789";
         Assert.Equal (10, text.Length);
@@ -1146,7 +1151,7 @@ public class AutoSizeTrueTests
         win.Clear ();
         win.Draw ();
 
-        Assert.Equal (new Rect (0, 0, 0, 1), label.Frame);
+        Assert.Equal (new Rectangle (0, 0, 0, 1), label.Frame);
         Assert.Equal (new Size (0, 1), label.TextFormatter.Size);
 
         Exception exception = Record.Exception (
@@ -1165,7 +1170,7 @@ public class AutoSizeTrueTests
 ";
 
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (0, 0, 10, 4), pos);
+        Assert.Equal (new Rectangle (0, 0, 10, 4), pos);
     }
 
     [Fact]
@@ -1274,17 +1279,17 @@ public class AutoSizeTrueTests
         Assert.False (view4.IsInitialized);
         Assert.False (view5.IsInitialized);
         Assert.True (view1.AutoSize);
-        Assert.Equal (new Rect (0, 0, 18, 1), view1.Frame);
+        Assert.Equal (new Rectangle (0, 0, 18, 1), view1.Frame);
         Assert.Equal ("Absolute(18)", view1.Width.ToString ());
         Assert.Equal ("Absolute(1)", view1.Height.ToString ());
         Assert.True (view2.AutoSize);
         Assert.Equal ("Say Hello view2 你".GetColumns (), view2.Width);
         Assert.Equal (18, view2.Width);
-        Assert.Equal (new Rect (0, 0, 18, 5), view2.Frame);
+        Assert.Equal (new Rectangle (0, 0, 18, 5), view2.Frame);
         Assert.Equal ("Absolute(18)", view2.Width.ToString ());
         Assert.Equal ("Absolute(5)", view2.Height.ToString ());
         Assert.True (view3.AutoSize);
-        Assert.Equal (new Rect (0, 0, 18, 1), view3.Frame); // BUGBUG: AutoSize = true, so the height should be 1.
+        Assert.Equal (new Rectangle (0, 0, 18, 1), view3.Frame); // BUGBUG: AutoSize = true, so the height should be 1.
         Assert.Equal ("Absolute(18)", view2.Width.ToString ());
         Assert.Equal ("Absolute(1)", view3.Height.ToString ());
         Assert.True (view4.AutoSize);
@@ -1292,13 +1297,13 @@ public class AutoSizeTrueTests
         Assert.Equal ("Say Hello view4 你".GetColumns (), view2.Width);
         Assert.Equal (18, view2.Width);
 
-        Assert.Equal (new Rect (0, 0, 18, 17), view4.Frame);
+        Assert.Equal (new Rectangle (0, 0, 18, 17), view4.Frame);
         Assert.Equal ("Absolute(18)", view4.Width.ToString ());
         Assert.Equal ("Absolute(17)", view4.Height.ToString ());
         Assert.True (view5.AutoSize);
-        Assert.Equal (new Rect (0, 0, 18, 17), view5.Frame);
+        Assert.Equal (new Rectangle (0, 0, 18, 17), view5.Frame);
         Assert.True (view6.AutoSize);
-        Assert.Equal (new Rect (0, 0, 2, 17), view6.Frame); // BUGBUG: AutoSize = true, so the Width should be 2.
+        Assert.Equal (new Rectangle (0, 0, 2, 17), view6.Frame); // BUGBUG: AutoSize = true, so the Width should be 2.
 
         top.BeginInit ();
         top.EndInit ();
@@ -1309,28 +1314,28 @@ public class AutoSizeTrueTests
         Assert.True (view4.IsInitialized);
         Assert.True (view5.IsInitialized);
         Assert.True (view1.AutoSize);
-        Assert.Equal (new Rect (0, 0, 18, 1), view1.Frame);
+        Assert.Equal (new Rectangle (0, 0, 18, 1), view1.Frame);
         Assert.Equal ("Absolute(18)", view1.Width.ToString ());
         Assert.Equal ("Absolute(1)", view1.Height.ToString ());
         Assert.True (view2.AutoSize);
 
-        Assert.Equal (new Rect (0, 0, 18, 5), view2.Frame);
+        Assert.Equal (new Rectangle (0, 0, 18, 5), view2.Frame);
         Assert.Equal ("Absolute(18)", view2.Width.ToString ());
         Assert.Equal ("Absolute(5)", view2.Height.ToString ());
         Assert.True (view3.AutoSize);
-        Assert.Equal (new Rect (0, 0, 18, 1), view3.Frame); // BUGBUG: AutoSize = true, so the height should be 1.
+        Assert.Equal (new Rectangle (0, 0, 18, 1), view3.Frame); // BUGBUG: AutoSize = true, so the height should be 1.
         Assert.Equal ("Absolute(18)", view5.Width.ToString ());
         Assert.Equal ("Absolute(1)", view3.Height.ToString ());
         Assert.True (view4.AutoSize);
-        Assert.Equal (new Rect (0, 0, 18, 17), view4.Frame);
+        Assert.Equal (new Rectangle (0, 0, 18, 17), view4.Frame);
         Assert.Equal ("Absolute(18)", view5.Width.ToString ());
         Assert.Equal ("Absolute(17)", view4.Height.ToString ());
         Assert.True (view5.AutoSize);
-        Assert.Equal (new Rect (0, 0, 18, 17), view5.Frame);
+        Assert.Equal (new Rectangle (0, 0, 18, 17), view5.Frame);
         Assert.Equal ("Absolute(18)", view5.Width.ToString ());
         Assert.Equal ("Absolute(17)", view5.Height.ToString ());
         Assert.True (view6.AutoSize);
-        Assert.Equal (new Rect (0, 0, 2, 17), view6.Frame); // BUGBUG: AutoSize = true, so the Width should be 2.
+        Assert.Equal (new Rectangle (0, 0, 2, 17), view6.Frame); // BUGBUG: AutoSize = true, so the Width should be 2.
         Assert.Equal ("Absolute(2)", view6.Width.ToString ());
         Assert.Equal ("Absolute(17)", view6.Height.ToString ());
     }
@@ -1379,11 +1384,11 @@ public class AutoSizeTrueTests
 
         Assert.Equal (5, text.Length);
         Assert.True (label.AutoSize);
-        Assert.Equal (new Rect (0, 0, 5, 1), label.Frame);
+        Assert.Equal (new Rectangle (0, 0, 5, 1), label.Frame);
         Assert.Equal (new Size (5, 1), label.TextFormatter.Size);
         Assert.Equal (new List<string> { "Label" }, label.TextFormatter.GetLines ());
-        Assert.Equal (new Rect (0, 0, 10, 4), win.Frame);
-        Assert.Equal (new Rect (0, 0, 10, 4), Application.Top.Frame);
+        Assert.Equal (new Rectangle (0, 0, 10, 4), win.Frame);
+        Assert.Equal (new Rectangle (0, 0, 10, 4), Application.Top.Frame);
 
         var expected = @"
 ┌────────┐
@@ -1392,8 +1397,8 @@ public class AutoSizeTrueTests
 └────────┘
 ";
 
-        Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (0, 0, 10, 4), pos);
+        Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
+        Assert.Equal (new Rectangle (0, 0, 10, 4), pos);
 
         text = "0123456789";
         Assert.Equal (10, text.Length);
@@ -1401,7 +1406,7 @@ public class AutoSizeTrueTests
         //label.Width = Dim.Fill () - text.Length;
         Application.Refresh ();
 
-        Assert.Equal (new Rect (0, 0, 5, 1), label.Frame);
+        Assert.Equal (new Rectangle (0, 0, 5, 1), label.Frame);
         Assert.Equal (new Size (5, 1), label.TextFormatter.Size);
         Exception exception = Record.Exception (() => Assert.Single (label.TextFormatter.GetLines ()));
         Assert.Null (exception);
@@ -1414,7 +1419,7 @@ public class AutoSizeTrueTests
 ";
 
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (0, 0, 10, 4), pos);
+        Assert.Equal (new Rectangle (0, 0, 10, 4), pos);
     }
 
     [Fact]
@@ -1437,11 +1442,11 @@ public class AutoSizeTrueTests
 
         Assert.Equal (5, text.Length);
         Assert.True (label.AutoSize);
-        Assert.Equal (new Rect (0, 0, 5, 1), label.Frame);
+        Assert.Equal (new Rectangle (0, 0, 5, 1), label.Frame);
         Assert.Equal (new Size (5, 1), label.TextFormatter.Size);
         Assert.Equal (new List<string> { "Label" }, label.TextFormatter.GetLines ());
-        Assert.Equal (new Rect (0, 0, 10, 4), win.Frame);
-        Assert.Equal (new Rect (0, 0, 10, 4), Application.Top.Frame);
+        Assert.Equal (new Rectangle (0, 0, 10, 4), win.Frame);
+        Assert.Equal (new Rectangle (0, 0, 10, 4), Application.Top.Frame);
 
         var expected = @"
 ┌────────┐
@@ -1450,8 +1455,8 @@ public class AutoSizeTrueTests
 └────────┘
 ";
 
-        Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (0, 0, 10, 4), pos);
+        Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
+        Assert.Equal (new Rectangle (0, 0, 10, 4), pos);
 
         text = "0123456789";
         Assert.Equal (10, text.Length);
@@ -1460,7 +1465,7 @@ public class AutoSizeTrueTests
         Application.Refresh ();
 
         Assert.True (label.AutoSize);
-        Assert.Equal (new Rect (0, 0, 5, 1), label.Frame);
+        Assert.Equal (new Rectangle (0, 0, 5, 1), label.Frame);
         Assert.Equal (new Size (5, 1), label.TextFormatter.Size);
         Assert.Single (label.TextFormatter.GetLines ());
 
@@ -1472,7 +1477,7 @@ public class AutoSizeTrueTests
 ";
 
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (0, 0, 10, 4), pos);
+        Assert.Equal (new Rectangle (0, 0, 10, 4), pos);
     }
 
     [Fact]
@@ -1486,7 +1491,8 @@ public class AutoSizeTrueTests
         super.LayoutSubviews ();
 
         Assert.True (label.AutoSize);
-        Assert.Equal ("(0,0,8,1)", label.Bounds.ToString ());
+        Rectangle expectedLabelBounds = new (0, 0, 8, 1);
+        Assert.Equal (expectedLabelBounds, label.Bounds);
         super.Dispose ();
     }
 
@@ -1505,7 +1511,7 @@ public class AutoSizeTrueTests
         top.EndInit ();
 
         Assert.True (label.AutoSize);
-        Assert.Equal (new Rect (0, 0, 5, 1), label.Frame);
+        Assert.Equal (new Rectangle (0, 0, 5, 1), label.Frame);
 
         top.LayoutSubviews ();
         top.Draw ();
@@ -1515,13 +1521,13 @@ HelloX
 Y     
 ";
 
-        Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
+        Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
 
         label.AutoSize = false;
         label.Width = 10;
         label.Height = 2;
         Assert.False (label.AutoSize);
-        Assert.Equal (new Rect (0, 0, 10, 2), label.Frame);
+        Assert.Equal (new Rectangle (0, 0, 10, 2), label.Frame);
 
         top.LayoutSubviews ();
         top.Draw ();
@@ -1554,7 +1560,7 @@ Y
         label.Text = "Hello";
         Application.Refresh ();
 
-        Assert.Equal (new Rect (0, 0, 1, 5), label.Frame); // BUGBUG: AutoSize = true, so the Width should be 1.
+        Assert.Equal (new Rectangle (0, 0, 1, 5), label.Frame); // BUGBUG: AutoSize = true, so the Width should be 1.
 
         var expected = @"
 HX
@@ -1565,7 +1571,7 @@ o
 Y 
 ";
 
-        Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
+        Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
 
         label.AutoSize = false;
         label.Width = 2;
@@ -1573,7 +1579,7 @@ Y
         Application.Refresh ();
 
         Assert.False (label.AutoSize);
-        Assert.Equal (new Rect (0, 0, 2, 10), label.Frame);
+        Assert.Equal (new Rectangle (0, 0, 2, 10), label.Frame);
 
         expected = @"
 H X
@@ -1608,13 +1614,13 @@ Y
         RunState rs = Application.Begin (Application.Top);
         ((FakeDriver)Application.Driver).SetBufferSize (15, 15);
 
-        Assert.Equal (new Rect (0, 0, 15, 15), win.Frame);
-        Assert.Equal (new Rect (0, 0, 15, 15), win.Margin.Frame);
-        Assert.Equal (new Rect (0, 0, 15, 15), win.Border.Frame);
-        Assert.Equal (new Rect (1, 1, 13, 13), win.Padding.Frame);
+        Assert.Equal (new Rectangle (0, 0, 15, 15), win.Frame);
+        Assert.Equal (new Rectangle (0, 0, 15, 15), win.Margin.Frame);
+        Assert.Equal (new Rectangle (0, 0, 15, 15), win.Border.Frame);
+        Assert.Equal (new Rectangle (1, 1, 13, 13), win.Padding.Frame);
         Assert.False (view.AutoSize);
         Assert.Equal (TextDirection.LeftRight_TopBottom, view.TextDirection);
-        Assert.Equal (Rect.Empty, view.Frame);
+        Assert.Equal (Rectangle.Empty, view.Frame);
         Assert.Equal ("Absolute(0)", view.X.ToString ());
         Assert.Equal ("Absolute(0)", view.Y.ToString ());
         Assert.Equal ("Absolute(0)", view.Width.ToString ());
@@ -1638,7 +1644,7 @@ Y
 └─────────────┘
 ";
 
-        Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
+        Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
 
         view.Text = "Hello World";
         view.Width = 11;
@@ -1646,7 +1652,7 @@ Y
         win.LayoutSubviews ();
         Application.Refresh ();
 
-        Assert.Equal (new Rect (0, 0, 11, 1), view.Frame);
+        Assert.Equal (new Rectangle (0, 0, 11, 1), view.Frame);
         Assert.Equal ("Absolute(0)", view.X.ToString ());
         Assert.Equal ("Absolute(0)", view.Y.ToString ());
         Assert.Equal ("Absolute(11)", view.Width.ToString ());
@@ -1677,7 +1683,7 @@ Y
         Application.Refresh ();
         int len = "Hello Worlds".Length;
         Assert.Equal (12, len);
-        Assert.Equal (new Rect (0, 0, len, 1), view.Frame);
+        Assert.Equal (new Rectangle (0, 0, len, 1), view.Frame);
         Assert.Equal ("Absolute(0)", view.X.ToString ());
         Assert.Equal ("Absolute(0)", view.Y.ToString ());
         Assert.Equal ("Absolute(12)", view.Width.ToString ());
@@ -1706,7 +1712,7 @@ Y
         view.TextDirection = TextDirection.TopBottom_LeftRight;
         Application.Refresh ();
 
-        Assert.Equal (new Rect (0, 0, 12, 12), view.Frame);
+        Assert.Equal (new Rectangle (0, 0, 12, 12), view.Frame);
         Assert.Equal ("Absolute(0)", view.X.ToString ());
         Assert.Equal ("Absolute(0)", view.Y.ToString ());
         Assert.Equal ("Absolute(12)", view.Width.ToString ());
@@ -1736,7 +1742,7 @@ Y
         view.Height = 1;
         Application.Refresh ();
 
-        Assert.Equal (new Rect (0, 0, 12, 1), view.Frame);
+        Assert.Equal (new Rectangle (0, 0, 12, 1), view.Frame);
         Assert.Equal ("Absolute(0)", view.X.ToString ());
         Assert.Equal ("Absolute(0)", view.Y.ToString ());
         Assert.Equal ("Absolute(12)", view.Width.ToString ());
@@ -1768,7 +1774,7 @@ Y
         view.PreserveTrailingSpaces = true;
         Application.Refresh ();
 
-        Assert.Equal (new Rect (0, 0, 12, 1), view.Frame);
+        Assert.Equal (new Rectangle (0, 0, 12, 1), view.Frame);
         Assert.Equal ("Absolute(0)", view.X.ToString ());
         Assert.Equal ("Absolute(0)", view.Y.ToString ());
         Assert.Equal ("Absolute(12)", view.Width.ToString ());
@@ -1795,13 +1801,13 @@ Y
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
 
         view.PreserveTrailingSpaces = false;
-        Rect f = view.Frame;
+        Rectangle f = view.Frame;
         view.Width = f.Height;
         view.Height = f.Width;
         view.TextDirection = TextDirection.TopBottom_LeftRight;
         Application.Refresh ();
 
-        Assert.Equal (new Rect (0, 0, 1, 12), view.Frame);
+        Assert.Equal (new Rectangle (0, 0, 1, 12), view.Frame);
         Assert.Equal ("Absolute(0)", view.X.ToString ());
         Assert.Equal ("Absolute(0)", view.Y.ToString ());
         Assert.Equal ("Absolute(1)", view.Width.ToString ());
@@ -1830,7 +1836,7 @@ Y
         view.AutoSize = true;
         Application.Refresh ();
 
-        Assert.Equal (new Rect (0, 0, 1, 12), view.Frame);
+        Assert.Equal (new Rectangle (0, 0, 1, 12), view.Frame);
         Assert.Equal ("Absolute(0)", view.X.ToString ());
         Assert.Equal ("Absolute(0)", view.Y.ToString ());
         Assert.Equal ("Absolute(1)", view.Width.ToString ());
@@ -1879,11 +1885,11 @@ Y
 
         Assert.Equal (5, text.Length);
         Assert.True (view.AutoSize);
-        Assert.Equal (new Rect (0, 0, 1, 5), view.Frame);
+        Assert.Equal (new Rectangle (0, 0, 1, 5), view.Frame);
         Assert.Equal (new Size (1, 5), view.TextFormatter.Size);
         Assert.Equal (new List<string> { "Views" }, view.TextFormatter.GetLines ());
-        Assert.Equal (new Rect (0, 0, 4, 10), win.Frame);
-        Assert.Equal (new Rect (0, 0, 4, 10), Application.Top.Frame);
+        Assert.Equal (new Rectangle (0, 0, 4, 10), win.Frame);
+        Assert.Equal (new Rectangle (0, 0, 4, 10), Application.Top.Frame);
 
         var expected = @"
 ┌──┐
@@ -1898,8 +1904,8 @@ Y
 └──┘
 ";
 
-        Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (0, 0, 4, 10), pos);
+        Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
+        Assert.Equal (new Rectangle (0, 0, 4, 10), pos);
 
         text = "0123456789";
         Assert.Equal (10, text.Length);
@@ -1907,7 +1913,7 @@ Y
         //view.Height = Dim.Fill () - text.Length;
         Application.Refresh ();
 
-        Assert.Equal (new Rect (0, 0, 1, 5), view.Frame);
+        Assert.Equal (new Rectangle (0, 0, 1, 5), view.Frame);
         Assert.Equal (new Size (1, 5), view.TextFormatter.Size);
         Exception exception = Record.Exception (() => Assert.Single (view.TextFormatter.GetLines ()));
         Assert.Null (exception);
@@ -1926,7 +1932,7 @@ Y
 ";
 
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (0, 0, 4, 10), pos);
+        Assert.Equal (new Rectangle (0, 0, 4, 10), pos);
     }
 
     [Fact]
@@ -1950,11 +1956,11 @@ Y
 
         Assert.Equal (5, text.Length);
         Assert.True (view.AutoSize);
-        Assert.Equal (new Rect (0, 0, 2, 5), view.Frame);
+        Assert.Equal (new Rectangle (0, 0, 2, 5), view.Frame);
         Assert.Equal (new Size (2, 5), view.TextFormatter.Size);
         Assert.Equal (new List<string> { "界View" }, view.TextFormatter.GetLines ());
-        Assert.Equal (new Rect (0, 0, 4, 10), win.Frame);
-        Assert.Equal (new Rect (0, 0, 4, 10), Application.Top.Frame);
+        Assert.Equal (new Rectangle (0, 0, 4, 10), win.Frame);
+        Assert.Equal (new Rectangle (0, 0, 4, 10), Application.Top.Frame);
 
         var expected = @"
 ┌──┐
@@ -1969,8 +1975,8 @@ Y
 └──┘
 ";
 
-        Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (0, 0, 4, 10), pos);
+        Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
+        Assert.Equal (new Rectangle (0, 0, 4, 10), pos);
 
         text = "0123456789";
         Assert.Equal (10, text.Length);
@@ -1978,7 +1984,7 @@ Y
         //view.Height = Dim.Fill () - text.Length;
         Application.Refresh ();
 
-        Assert.Equal (new Rect (0, 0, 2, 5), view.Frame);
+        Assert.Equal (new Rectangle (0, 0, 2, 5), view.Frame);
         Assert.Equal (new Size (2, 5), view.TextFormatter.Size);
 
         Exception exception = Record.Exception (
@@ -2003,7 +2009,7 @@ Y
 ";
 
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (0, 0, 4, 10), pos);
+        Assert.Equal (new Rectangle (0, 0, 4, 10), pos);
     }
 
     [Fact]
@@ -2047,8 +2053,8 @@ Y
 
         Assert.True (horizontalView.AutoSize);
         Assert.True (verticalView.AutoSize);
-        Assert.Equal (new Rect (0, 0, 11, 2), horizontalView.Frame);
-        Assert.Equal (new Rect (0, 3, 11, 11), verticalView.Frame);
+        Assert.Equal (new Rectangle (0, 0, 11, 2), horizontalView.Frame);
+        Assert.Equal (new Rectangle (0, 3, 11, 11), verticalView.Frame);
 
         var expected = @"
 ┌──────────────────┐
@@ -2073,11 +2079,11 @@ Y
 └──────────────────┘
 ";
 
-        Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
+        Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
 
         verticalView.Text = $"最初の行{Environment.NewLine}二行目";
         Application.Top.Draw ();
-        Assert.Equal (new Rect (0, 3, 11, 11), verticalView.Frame);
+        Assert.Equal (new Rectangle (0, 3, 11, 11), verticalView.Frame);
 
         expected = @"
 ┌──────────────────┐
@@ -2135,8 +2141,8 @@ Y
         Assert.True (verticalView.AutoSize);
         Assert.Equal (new Size (text.GetColumns (), 1), horizontalView.TextFormatter.Size);
         Assert.Equal (new Size (2, 9), verticalView.TextFormatter.Size);
-        Assert.Equal (new Rect (0, 0, 10, 1), horizontalView.Frame);
-        Assert.Equal (new Rect (0, 3, 10, 9), verticalView.Frame);
+        Assert.Equal (new Rectangle (0, 0, 10, 1), horizontalView.Frame);
+        Assert.Equal (new Rectangle (0, 3, 10, 9), verticalView.Frame);
 
         var expected = @"
 ┌────────────────────┐
@@ -2163,7 +2169,7 @@ Y
 └────────────────────┘
 ";
 
-        Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
+        Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
 
         verticalView.Text = "最初_の行二行目";
         Application.Top.Draw ();
@@ -2171,7 +2177,7 @@ Y
         Assert.True (verticalView.AutoSize);
 
         // height was initialized with 8 and can only grow or keep initial value
-        Assert.Equal (new Rect (0, 3, 10, 9), verticalView.Frame);
+        Assert.Equal (new Rectangle (0, 3, 10, 9), verticalView.Frame);
 
         expected = @"
 ┌────────────────────┐
@@ -2258,9 +2264,9 @@ Y
         // Here the AutoSize ensuring the right size with width 3 (Dim.Absolute)
         // that was set on the OnAdded method with the text length of 3
         // and height 1 because wasn't set and the text has 1 line
-        Assert.Equal (new Rect (0, 0, 3, 1), lbl.Frame);
-        Assert.Equal (new Rect (0, 0, 3, 1), lbl._needsDisplayRect);
-        Assert.Equal (new Rect (0, 0, 0, 0), lbl.SuperView._needsDisplayRect);
+        Assert.Equal (new Rectangle (0, 0, 3, 1), lbl.Frame);
+        Assert.Equal (new Rectangle (0, 0, 3, 1), lbl._needsDisplayRect);
+        Assert.Equal (new Rectangle (0, 0, 0, 0), lbl.SuperView._needsDisplayRect);
         Assert.True (lbl.SuperView.LayoutNeeded);
         lbl.SuperView.Draw ();
         Assert.Equal ("12  ", GetContents ());
@@ -2684,12 +2690,12 @@ Y
         ((FakeDriver)Application.Driver).SetBufferSize (50, 50);
 
         Assert.True (horizontalView.AutoSize);
-        Assert.Equal (new Rect (0, 0, 12, 1), horizontalView.Frame);
+        Assert.Equal (new Rectangle (0, 0, 12, 1), horizontalView.Frame);
         Assert.Equal (new Size (12, 1), horizontalView.GetSizeNeededForTextWithoutHotKey ());
         Assert.Equal (horizontalView.Frame.Size, horizontalView.GetSizeNeededForTextWithoutHotKey ());
 
         Assert.True (verticalView.AutoSize);
-        Assert.Equal (new Rect (0, 0, 2, 11), verticalView.Frame);
+        Assert.Equal (new Rectangle (0, 0, 2, 11), verticalView.Frame);
         Assert.Equal (new Size (2, 11), verticalView.GetSizeNeededForTextWithoutHotKey ());
         Assert.Equal (verticalView.Frame.Size, verticalView.GetSizeNeededForTextWithoutHotKey ());
 
@@ -2698,12 +2704,12 @@ Y
         verticalView.Text = text;
 
         Assert.True (horizontalView.AutoSize);
-        Assert.Equal (new Rect (0, 0, 12, 1), horizontalView.Frame);
+        Assert.Equal (new Rectangle (0, 0, 12, 1), horizontalView.Frame);
         Assert.Equal (new Size (12, 1), horizontalView.GetSizeNeededForTextWithoutHotKey ());
         Assert.Equal (horizontalView.Frame.Size, horizontalView.GetSizeNeededForTextWithoutHotKey ());
 
         Assert.True (verticalView.AutoSize);
-        Assert.Equal (new Rect (0, 0, 2, 11), verticalView.Frame);
+        Assert.Equal (new Rectangle (0, 0, 2, 11), verticalView.Frame);
         Assert.Equal (new Size (2, 11), verticalView.GetSizeNeededForTextWithoutHotKey ());
         Assert.Equal (verticalView.Frame.Size, verticalView.GetSizeNeededForTextWithoutHotKey ());
     }
@@ -2711,22 +2717,22 @@ Y
     [Fact]
     public void SetRelativeLayout_Respects_AutoSize ()
     {
-        var view = new View { Frame = new Rect (0, 0, 10, 0), AutoSize = true };
+        var view = new View { Frame = new Rectangle (0, 0, 10, 0), AutoSize = true };
         view.Text = "01234567890123456789";
 
         Assert.True (view.AutoSize);
         Assert.Equal (LayoutStyle.Absolute, view.LayoutStyle);
-        Assert.Equal (new Rect (0, 0, 20, 1), view.Frame);
+        Assert.Equal (new Rectangle (0, 0, 20, 1), view.Frame);
         Assert.Equal ("Absolute(0)", view.X.ToString ());
         Assert.Equal ("Absolute(0)", view.Y.ToString ());
         Assert.Equal ("Absolute(20)", view.Width.ToString ());
         Assert.Equal ("Absolute(1)", view.Height.ToString ());
 
-        view.SetRelativeLayout (new Rect (0, 0, 25, 5));
+        view.SetRelativeLayout (new Rectangle (0, 0, 25, 5));
 
         Assert.True (view.AutoSize);
         Assert.Equal (LayoutStyle.Absolute, view.LayoutStyle);
-        Assert.Equal (new Rect (0, 0, 20, 1), view.Frame);
+        Assert.Equal (new Rectangle (0, 0, 20, 1), view.Frame);
         Assert.Equal ("Absolute(0)", view.X.ToString ());
         Assert.Equal ("Absolute(0)", view.Y.ToString ());
         Assert.Equal ("Absolute(20)", view.Width.ToString ());
@@ -2737,11 +2743,11 @@ Y
     [AutoInitShutdown]
     public void Setting_Frame_Dont_Respect_AutoSize_True_On_Layout_Absolute ()
     {
-        var view1 = new View { Frame = new Rect (0, 0, 10, 0), Text = "Say Hello view1 你", AutoSize = true };
+        var view1 = new View { Frame = new Rectangle (0, 0, 10, 0), Text = "Say Hello view1 你", AutoSize = true };
 
         var viewTopBottom_LeftRight = new View
         {
-            Frame = new Rect (0, 0, 0, 10),
+            Frame = new Rectangle (0, 0, 0, 10),
             Text = "Say Hello view2 你",
             AutoSize = true,
             TextDirection =
@@ -2753,7 +2759,7 @@ Y
 
         Assert.True (view1.AutoSize);
         Assert.Equal (LayoutStyle.Absolute, view1.LayoutStyle);
-        Assert.Equal (new Rect (0, 0, 18, 1), view1.Frame);
+        Assert.Equal (new Rectangle (0, 0, 18, 1), view1.Frame);
         Assert.Equal ("Absolute(0)", view1.X.ToString ());
         Assert.Equal ("Absolute(0)", view1.Y.ToString ());
         Assert.Equal ("Absolute(18)", view1.Width.ToString ());
@@ -2761,30 +2767,30 @@ Y
 
         Assert.True (viewTopBottom_LeftRight.AutoSize);
         Assert.Equal (LayoutStyle.Absolute, viewTopBottom_LeftRight.LayoutStyle);
-        Assert.Equal (new Rect (0, 0, 18, 17), viewTopBottom_LeftRight.Frame);
+        Assert.Equal (new Rectangle (0, 0, 18, 17), viewTopBottom_LeftRight.Frame);
         Assert.Equal ("Absolute(0)", viewTopBottom_LeftRight.X.ToString ());
         Assert.Equal ("Absolute(0)", viewTopBottom_LeftRight.Y.ToString ());
         Assert.Equal ("Absolute(18)", viewTopBottom_LeftRight.Width.ToString ());
         Assert.Equal ("Absolute(17)", viewTopBottom_LeftRight.Height.ToString ());
 
-        view1.Frame = new Rect (0, 0, 25, 4);
+        view1.Frame = new Rectangle (0, 0, 25, 4);
         var firstIteration = false;
         Application.RunIteration (ref rs, ref firstIteration);
 
         Assert.True (view1.AutoSize);
         Assert.Equal (LayoutStyle.Absolute, view1.LayoutStyle);
-        Assert.Equal (new Rect (0, 0, 25, 4), view1.Frame);
+        Assert.Equal (new Rectangle (0, 0, 25, 4), view1.Frame);
         Assert.Equal ("Absolute(0)", view1.X.ToString ());
         Assert.Equal ("Absolute(0)", view1.Y.ToString ());
         Assert.Equal ("Absolute(25)", view1.Width.ToString ());
         Assert.Equal ("Absolute(4)", view1.Height.ToString ());
 
-        viewTopBottom_LeftRight.Frame = new Rect (0, 0, 1, 25);
+        viewTopBottom_LeftRight.Frame = new Rectangle (0, 0, 1, 25);
         Application.RunIteration (ref rs, ref firstIteration);
 
         Assert.True (viewTopBottom_LeftRight.AutoSize);
         Assert.Equal (LayoutStyle.Absolute, viewTopBottom_LeftRight.LayoutStyle);
-        Assert.Equal (new Rect (0, 0, 2, 25), viewTopBottom_LeftRight.Frame);
+        Assert.Equal (new Rectangle (0, 0, 2, 25), viewTopBottom_LeftRight.Frame);
         Assert.Equal ("Absolute(0)", viewTopBottom_LeftRight.X.ToString ());
         Assert.Equal ("Absolute(0)", viewTopBottom_LeftRight.Y.ToString ());
         Assert.Equal ("Absolute(2)", viewTopBottom_LeftRight.Width.ToString ());
@@ -2922,7 +2928,7 @@ Y
             Assert.Equal (new Size (width, 1), lblJust.TextFormatter.Size);
         }
 
-        Assert.Equal (new Rect (0, 0, width + 2, 6), frame.Frame);
+        Assert.Equal (new Rectangle (0, 0, width + 2, 6), frame.Frame);
 
         var expected = @"
 ┌────────────────────┐
@@ -2934,8 +2940,8 @@ Y
 "
             ;
 
-        Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (0, 0, width + 2, 6), pos);
+        Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
+        Assert.Equal (new Rectangle (0, 0, width + 2, 6), pos);
     }
 
     [Theory]
@@ -3010,7 +3016,7 @@ Y
             Assert.Equal (new Size (1, 11), lblCenter.TextFormatter.Size);
             Assert.Equal (new Size (1, 11), lblRight.TextFormatter.Size);
             Assert.Equal (new Size (1, height), lblJust.TextFormatter.Size);
-            Assert.Equal (new Rect (0, 0, 9, height + 2), frame.Frame);
+            Assert.Equal (new Rectangle (0, 0, 9, height + 2), frame.Frame);
         }
         else
         {
@@ -3018,7 +3024,7 @@ Y
             Assert.Equal (new Size (1, height), lblCenter.TextFormatter.Size);
             Assert.Equal (new Size (1, height), lblRight.TextFormatter.Size);
             Assert.Equal (new Size (1, height), lblJust.TextFormatter.Size);
-            Assert.Equal (new Rect (0, 0, 9, height + 2), frame.Frame);
+            Assert.Equal (new Rectangle (0, 0, 9, height + 2), frame.Frame);
         }
 
         var expected = @"
@@ -3047,7 +3053,7 @@ Y
 "
             ;
 
-        Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (0, 0, 9, height + 2), pos);
+        Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
+        Assert.Equal (new Rectangle (0, 0, 9, height + 2), pos);
     }
 }

+ 71 - 76
UnitTests/View/ViewTests.cs

@@ -1,4 +1,4 @@
-using System.ComponentModel;
+using System.ComponentModel;
 using System.Text;
 using Xunit.Abstractions;
 
@@ -17,8 +17,8 @@ public class ViewTests
 
         view.DrawContent += (s, e) =>
                             {
-                                Rect savedClip = Application.Driver.Clip;
-                                Application.Driver.Clip = new Rect (1, 1, view.Bounds.Width, view.Bounds.Height);
+                                Rectangle savedClip = Application.Driver.Clip;
+                                Application.Driver.Clip = new Rectangle (1, 1, view.Bounds.Width, view.Bounds.Height);
 
                                 for (var row = 0; row < view.Bounds.Height; row++)
                                 {
@@ -50,8 +50,8 @@ public class ViewTests
 └──────────────────┘
 ";
 
-        Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (0, 0, 20, 10), pos);
+        Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
+        Assert.Equal (new Rectangle (0, 0, 20, 10), pos);
 
         view.Clear (view.Frame);
 
@@ -59,7 +59,7 @@ public class ViewTests
 ";
 
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (Rect.Empty, pos);
+        Assert.Equal (Rectangle.Empty, pos);
     }
 
     [Fact]
@@ -70,8 +70,8 @@ public class ViewTests
 
         view.DrawContent += (s, e) =>
                             {
-                                Rect savedClip = Application.Driver.Clip;
-                                Application.Driver.Clip = new Rect (1, 1, view.Bounds.Width, view.Bounds.Height);
+                                Rectangle savedClip = Application.Driver.Clip;
+                                Application.Driver.Clip = new Rectangle (1, 1, view.Bounds.Width, view.Bounds.Height);
 
                                 for (var row = 0; row < view.Bounds.Height; row++)
                                 {
@@ -103,8 +103,8 @@ public class ViewTests
 └──────────────────┘
 ";
 
-        Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (0, 0, 20, 10), pos);
+        Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
+        Assert.Equal (new Rectangle (0, 0, 20, 10), pos);
 
         view.Clear (view.Frame);
 
@@ -112,7 +112,7 @@ public class ViewTests
 ";
 
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (Rect.Empty, pos);
+        Assert.Equal (Rectangle.Empty, pos);
     }
 
     [Theory]
@@ -136,13 +136,13 @@ public class ViewTests
         {
             Assert.True (v.AutoSize);
             Assert.False (v.CanFocus);
-            Assert.Equal (new Rect (0, 0, 100, 1), v.Frame);
+            Assert.Equal (new Rectangle (0, 0, 100, 1), v.Frame);
         }
         else
         {
             Assert.False (v.AutoSize);
             Assert.True (v.CanFocus);
-            Assert.Equal (new Rect (0, 0, 20, 1), v.Frame);
+            Assert.Equal (new Rectangle (0, 0, 20, 1), v.Frame);
         }
 
         TestHelpers.AssertDriverContentsWithFrameAre (
@@ -227,11 +227,11 @@ At 0,0
                                                       _output
                                                      );
 
-        view.Frame = new Rect (3, 3, 10, 1);
-        Assert.Equal (new Rect (3, 3, 10, 1), view.Frame);
+        view.Frame = new Rectangle (3, 3, 10, 1);
+        Assert.Equal (new Rectangle (3, 3, 10, 1), view.Frame);
         Assert.Equal (LayoutStyle.Absolute, view.LayoutStyle);
-        Assert.Equal (new Rect (0, 0, 10, 1), view.Bounds);
-        Assert.Equal (new Rect (0, 0, 10, 1), view._needsDisplayRect);
+        Assert.Equal (new Rectangle (0, 0, 10, 1), view.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 10, 1), view._needsDisplayRect);
         top.Draw ();
 
         TestHelpers.AssertDriverContentsWithFrameAre (
@@ -278,9 +278,9 @@ At 0,0
         view.Y = 3;
         view.Width = 10;
         view.Height = 1;
-        Assert.Equal (new Rect (3, 3, 10, 1), view.Frame);
-        Assert.Equal (new Rect (0, 0, 10, 1), view.Bounds);
-        Assert.Equal (new Rect (0, 0, 30, 2), view._needsDisplayRect);
+        Assert.Equal (new Rectangle (3, 3, 10, 1), view.Frame);
+        Assert.Equal (new Rectangle (0, 0, 10, 1), view.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 30, 2), view._needsDisplayRect);
         top.Draw ();
 
         TestHelpers.AssertDriverContentsWithFrameAre (
@@ -323,11 +323,11 @@ At 0,0
                                                       _output
                                                      );
 
-        view.Frame = new Rect (1, 1, 10, 1);
-        Assert.Equal (new Rect (1, 1, 10, 1), view.Frame);
+        view.Frame = new Rectangle (1, 1, 10, 1);
+        Assert.Equal (new Rectangle (1, 1, 10, 1), view.Frame);
         Assert.Equal (LayoutStyle.Absolute, view.LayoutStyle);
-        Assert.Equal (new Rect (0, 0, 10, 1), view.Bounds);
-        Assert.Equal (new Rect (0, 0, 10, 1), view._needsDisplayRect);
+        Assert.Equal (new Rectangle (0, 0, 10, 1), view.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 10, 1), view._needsDisplayRect);
         top.Draw ();
 
         TestHelpers.AssertDriverContentsWithFrameAre (
@@ -372,9 +372,9 @@ At 0,0
         view.Y = 1;
         view.Width = 10;
         view.Height = 1;
-        Assert.Equal (new Rect (1, 1, 10, 1), view.Frame);
-        Assert.Equal (new Rect (0, 0, 10, 1), view.Bounds);
-        Assert.Equal (new Rect (0, 0, 30, 2), view._needsDisplayRect);
+        Assert.Equal (new Rectangle (1, 1, 10, 1), view.Frame);
+        Assert.Equal (new Rectangle (0, 0, 10, 1), view.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 30, 2), view._needsDisplayRect);
         top.Draw ();
 
         TestHelpers.AssertDriverContentsWithFrameAre (
@@ -455,29 +455,29 @@ At 0,0
 
         RunState runState = Application.Begin (top);
 
-        top.LayoutComplete += (s, e) => { Assert.Equal (new Rect (0, 0, 80, 25), top._needsDisplayRect); };
+        top.LayoutComplete += (s, e) => { Assert.Equal (new Rectangle (0, 0, 80, 25), top._needsDisplayRect); };
 
-        frame.LayoutComplete += (s, e) => { Assert.Equal (new Rect (0, 0, 40, 8), frame._needsDisplayRect); };
+        frame.LayoutComplete += (s, e) => { Assert.Equal (new Rectangle (0, 0, 40, 8), frame._needsDisplayRect); };
 
-        label.LayoutComplete += (s, e) => { Assert.Equal (new Rect (0, 0, 38, 1), label._needsDisplayRect); };
+        label.LayoutComplete += (s, e) => { Assert.Equal (new Rectangle (0, 0, 38, 1), label._needsDisplayRect); };
 
-        button.LayoutComplete += (s, e) => { Assert.Equal (new Rect (0, 0, 13, 1), button._needsDisplayRect); };
+        button.LayoutComplete += (s, e) => { Assert.Equal (new Rectangle (0, 0, 13, 1), button._needsDisplayRect); };
 
         Assert.True (label.AutoSize);
-        Assert.Equal (new Rect (0, 0, 80, 25), top.Frame);
-        Assert.Equal (new Rect (20, 8, 40, 8), frame.Frame);
+        Assert.Equal (new Rectangle (0, 0, 80, 25), top.Frame);
+        Assert.Equal (new Rectangle (20, 8, 40, 8), frame.Frame);
 
         Assert.Equal (
-                      new Rect (20, 8, 60, 16),
-                      new Rect (
+                      new Rectangle (20, 8, 60, 16),
+                      new Rectangle (
                                 frame.Frame.Left,
                                 frame.Frame.Top,
                                 frame.Frame.Right,
                                 frame.Frame.Bottom
                                )
                      );
-        Assert.Equal (new Rect (0, 0, 30, 1), label.Frame);
-        Assert.Equal (new Rect (0, 1, 13, 1), button.Frame); // this proves frame was set
+        Assert.Equal (new Rectangle (0, 0, 30, 1), label.Frame);
+        Assert.Equal (new Rectangle (0, 1, 13, 1), button.Frame); // this proves frame was set
         Application.End (runState);
     }
 
@@ -536,9 +536,9 @@ At 0,0
                                                       _output
                                                      );
 
-        view.Frame = new Rect (3, 3, 10, 1);
-        Assert.Equal (new Rect (0, 0, 10, 1), view.Bounds);
-        Assert.Equal (new Rect (0, 0, 10, 1), view._needsDisplayRect);
+        view.Frame = new Rectangle (3, 3, 10, 1);
+        Assert.Equal (new Rectangle (0, 0, 10, 1), view.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 10, 1), view._needsDisplayRect);
         view.Draw ();
 
         TestHelpers.AssertDriverContentsWithFrameAre (
@@ -585,9 +585,9 @@ At 0,0
         view.Y = 3;
         view.Width = 10;
         view.Height = 1;
-        Assert.Equal (new Rect (3, 3, 10, 1), view.Frame);
-        Assert.Equal (new Rect (0, 0, 10, 1), view.Bounds);
-        Assert.Equal (new Rect (0, 0, 30, 2), view._needsDisplayRect);
+        Assert.Equal (new Rectangle (3, 3, 10, 1), view.Frame);
+        Assert.Equal (new Rectangle (0, 0, 10, 1), view.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 30, 2), view._needsDisplayRect);
         view.Draw ();
 
         TestHelpers.AssertDriverContentsWithFrameAre (
@@ -630,11 +630,11 @@ At 0,0
                                                       _output
                                                      );
 
-        view.Frame = new Rect (1, 1, 10, 1);
-        Assert.Equal (new Rect (1, 1, 10, 1), view.Frame);
+        view.Frame = new Rectangle (1, 1, 10, 1);
+        Assert.Equal (new Rectangle (1, 1, 10, 1), view.Frame);
         Assert.Equal (LayoutStyle.Absolute, view.LayoutStyle);
-        Assert.Equal (new Rect (0, 0, 10, 1), view.Bounds);
-        Assert.Equal (new Rect (0, 0, 10, 1), view._needsDisplayRect);
+        Assert.Equal (new Rectangle (0, 0, 10, 1), view.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 10, 1), view._needsDisplayRect);
         view.Draw ();
 
         TestHelpers.AssertDriverContentsWithFrameAre (
@@ -681,9 +681,9 @@ At 0,0
         view.Y = 1;
         view.Width = 10;
         view.Height = 1;
-        Assert.Equal (new Rect (1, 1, 10, 1), view.Frame);
-        Assert.Equal (new Rect (0, 0, 10, 1), view.Bounds);
-        Assert.Equal (new Rect (0, 0, 30, 2), view._needsDisplayRect);
+        Assert.Equal (new Rectangle (1, 1, 10, 1), view.Frame);
+        Assert.Equal (new Rectangle (0, 0, 10, 1), view.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 30, 2), view._needsDisplayRect);
         view.Draw ();
 
         TestHelpers.AssertDriverContentsWithFrameAre (
@@ -700,7 +700,7 @@ At 0,0
     [Fact]
     public void Internal_Tests ()
     {
-        var rect = new Rect (1, 1, 10, 1);
+        var rect = new Rectangle (1, 1, 10, 1);
         var view = new View { Frame = rect };
     }
 
@@ -727,11 +727,11 @@ At 0,0
         var r = new View ();
         Assert.NotNull (r);
         Assert.Equal (LayoutStyle.Absolute, r.LayoutStyle);
-        Assert.Equal ("View()(0,0,0,0)", r.ToString ());
+        Assert.Equal ($"View(){r.Bounds}", r.ToString ());
         Assert.False (r.CanFocus);
         Assert.False (r.HasFocus);
-        Assert.Equal (new Rect (0, 0, 0, 0), r.Bounds);
-        Assert.Equal (new Rect (0, 0, 0, 0), r.Frame);
+        Assert.Equal (new Rectangle (0, 0, 0, 0), r.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 0, 0), r.Frame);
         Assert.Null (r.Focused);
         Assert.Null (r.ColorScheme);
         Assert.Equal (0, r.Width);
@@ -749,14 +749,14 @@ At 0,0
         r.Dispose ();
 
         // Empty Rect
-        r = new View { Frame = Rect.Empty };
+        r = new View { Frame = Rectangle.Empty };
         Assert.NotNull (r);
         Assert.Equal (LayoutStyle.Absolute, r.LayoutStyle);
-        Assert.Equal ("View()(0,0,0,0)", r.ToString ());
+        Assert.Equal ($"View(){r.Bounds}", r.ToString ());
         Assert.False (r.CanFocus);
         Assert.False (r.HasFocus);
-        Assert.Equal (new Rect (0, 0, 0, 0), r.Bounds);
-        Assert.Equal (new Rect (0, 0, 0, 0), r.Frame);
+        Assert.Equal (new Rectangle (0, 0, 0, 0), r.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 0, 0), r.Frame);
         Assert.Null (r.Focused);
         Assert.Null (r.ColorScheme);
         Assert.Equal (0, r.Width);
@@ -774,14 +774,14 @@ At 0,0
         r.Dispose ();
 
         // Rect with values
-        r = new View { Frame = new Rect (1, 2, 3, 4) };
+        r = new View { Frame = new Rectangle (1, 2, 3, 4) };
         Assert.NotNull (r);
         Assert.Equal (LayoutStyle.Absolute, r.LayoutStyle);
-        Assert.Equal ("View()(1,2,3,4)", r.ToString ());
+        Assert.Equal ($"View(){r.Frame}", r.ToString ());
         Assert.False (r.CanFocus);
         Assert.False (r.HasFocus);
-        Assert.Equal (new Rect (0, 0, 3, 4), r.Bounds);
-        Assert.Equal (new Rect (1, 2, 3, 4), r.Frame);
+        Assert.Equal (new Rectangle (0, 0, 3, 4), r.Bounds);
+        Assert.Equal (new Rectangle (1, 2, 3, 4), r.Frame);
         Assert.Null (r.Focused);
         Assert.Null (r.ColorScheme);
         Assert.Equal (3, r.Width);
@@ -809,15 +809,10 @@ At 0,0
         // BUGBUG: IsInitialized must be true to process calculation
         r.BeginInit ();
         r.EndInit ();
-#if DEBUG
-        Assert.Equal ("View(Vertical View)(0,0,1,13)", r.ToString ());
-#else
-        Assert.Equal ("View()(0,0,1,13)", r.ToString ());
-#endif
         Assert.False (r.CanFocus);
         Assert.False (r.HasFocus);
-        Assert.Equal (new Rect (0, 0, 1, 13), r.Bounds);
-        Assert.Equal (new Rect (0, 0, 1, 13), r.Frame);
+        Assert.Equal (new Rectangle (0, 0, 1, 13), r.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 1, 13), r.Frame);
         Assert.Null (r.Focused);
         Assert.Null (r.ColorScheme);
         Assert.False (r.IsCurrentTop);
@@ -901,7 +896,7 @@ At 0,0
         var view = new View { X = 1, Y = 2, Width = 3, Height = 4 };
 
         // Object Initializer Absolute
-        var super = new View { Frame = new Rect (0, 0, 10, 10) };
+        var super = new View { Frame = new Rectangle (0, 0, 10, 10) };
         super.Add (view);
         super.BeginInit ();
         super.EndInit ();
@@ -912,9 +907,9 @@ At 0,0
         Assert.Equal (3, view.Width);
         Assert.Equal (4, view.Height);
         Assert.False (view.Frame.IsEmpty);
-        Assert.Equal (new Rect (1, 2, 3, 4), view.Frame);
+        Assert.Equal (new Rectangle (1, 2, 3, 4), view.Frame);
         Assert.False (view.Bounds.IsEmpty);
-        Assert.Equal (new Rect (0, 0, 3, 4), view.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 3, 4), view.Bounds);
 
         view.LayoutSubviews ();
 
@@ -956,7 +951,7 @@ At 0,0
         view.Y = 2;
         view.Width = 3;
         view.Height = 4;
-        super = new View { Frame = new Rect (0, 0, 10, 10) };
+        super = new View { Frame = new Rectangle (0, 0, 10, 10) };
         super.Add (view);
         super.BeginInit ();
         super.EndInit ();
@@ -966,9 +961,9 @@ At 0,0
         Assert.Equal (3, view.Width);
         Assert.Equal (4, view.Height);
         Assert.False (view.Frame.IsEmpty);
-        Assert.Equal (new Rect (1, 2, 3, 4), view.Frame);
+        Assert.Equal (new Rectangle (1, 2, 3, 4), view.Frame);
         Assert.False (view.Bounds.IsEmpty);
-        Assert.Equal (new Rect (0, 0, 3, 4), view.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 3, 4), view.Bounds);
         super.Dispose ();
     }
 
@@ -1103,7 +1098,7 @@ At 0,0
         public bool IsKeyUp { get; set; }
         public override string Text { get; set; }
 
-        public override void OnDrawContent (Rect contentArea)
+        public override void OnDrawContent (Rectangle contentArea)
         {
             var idx = 0;
 

+ 2 - 2
UnitTests/Views/AllViewsTests.cs

@@ -196,9 +196,9 @@ public class AllViewsTests
     // create the right type of argument for the constructor.
     private static void AddArguments (Type paramType, List<object> pTypes)
     {
-        if (paramType == typeof (Rect))
+        if (paramType == typeof (Rectangle))
         {
-            pTypes.Add (Rect.Empty);
+            pTypes.Add (Rectangle.Empty);
         }
         else if (paramType == typeof (string))
         {

+ 25 - 25
UnitTests/Views/ButtonTests.cs

@@ -1,4 +1,4 @@
-using System.ComponentModel;
+using System.ComponentModel;
 using Xunit.Abstractions;
 
 namespace Terminal.Gui.ViewsTests;
@@ -118,20 +118,20 @@ public class ButtonTests
         Application.Begin (Application.Top);
         ((FakeDriver)Application.Driver).SetBufferSize (54, 11);
 
-        Assert.Equal (new Rect (0, 0, 54, 11), win.Frame);
-        Assert.Equal (new Rect (0, 0, 52, 9), tabView.Frame);
-        Assert.Equal (new Rect (0, 0, 50, 7), tab.Frame);
-        Assert.Equal (new Rect (0, 1, 8, 1), view.Frame);
-        Assert.Equal (new Rect (9, 1, 20, 1), txtToFind.Frame);
+        Assert.Equal (new Rectangle (0, 0, 54, 11), win.Frame);
+        Assert.Equal (new Rectangle (0, 0, 52, 9), tabView.Frame);
+        Assert.Equal (new Rectangle (0, 0, 50, 7), tab.Frame);
+        Assert.Equal (new Rectangle (0, 1, 8, 1), view.Frame);
+        Assert.Equal (new Rectangle (9, 1, 20, 1), txtToFind.Frame);
 
         Assert.Equal (0, txtToFind.ScrollOffset);
         Assert.Equal (16, txtToFind.CursorPosition);
 
-        Assert.Equal (new Rect (30, 1, 20, 1), btnFindNext.Frame);
-        Assert.Equal (new Rect (30, 2, 20, 1), btnFindPrevious.Frame);
-        Assert.Equal (new Rect (30, 4, 20, 1), btnCancel.Frame);
-//        Assert.Equal (new Rect (0, 3, 12, 1), ckbMatchCase.Frame);
-//        Assert.Equal (new Rect (0, 4, 18, 1), ckbMatchWholeWord.Frame);
+        Assert.Equal (new (30, 1, 20, 1), btnFindNext.Frame);
+        Assert.Equal (new (30, 2, 20, 1), btnFindPrevious.Frame);
+        Assert.Equal (new (30, 4, 20, 1), btnCancel.Frame);
+//        Assert.Equal (new (0, 3, 12, 1), ckbMatchCase.Frame);
+//        Assert.Equal (new (0, 4, 18, 1), ckbMatchWholeWord.Frame);
 
         var btn1 =
             $"{
@@ -432,15 +432,15 @@ public class ButtonTests
         Assert.Equal (TextAlignment.Centered, btn.TextAlignment);
         Assert.Equal ('_', btn.HotKeySpecifier.Value);
         Assert.True (btn.CanFocus);
-        Assert.Equal (new Rect (0, 0, 4, 1), btn.Bounds);
-        Assert.Equal (new Rect (0, 0, 4, 1), btn.Frame);
+        Assert.Equal (new Rectangle (0, 0, 4, 1), btn.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 4, 1), btn.Frame);
         Assert.Equal ($"{CM.Glyphs.LeftBracket}  {CM.Glyphs.RightBracket}", btn.TextFormatter.Text);
         Assert.False (btn.IsDefault);
         Assert.Equal (TextAlignment.Centered, btn.TextAlignment);
         Assert.Equal ('_', btn.HotKeySpecifier.Value);
         Assert.True (btn.CanFocus);
-        Assert.Equal (new Rect (0, 0, 4, 1), btn.Bounds);
-        Assert.Equal (new Rect (0, 0, 4, 1), btn.Frame);
+        Assert.Equal (new Rectangle (0, 0, 4, 1), btn.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 4, 1), btn.Frame);
 
         Assert.Equal (string.Empty, btn.Title);
         Assert.Equal (KeyCode.Null, btn.HotKey);
@@ -478,8 +478,8 @@ public class ButtonTests
         Assert.True (btn.IsDefault);
         Assert.Equal (TextAlignment.Centered, btn.TextAlignment);
         Assert.True (btn.CanFocus);
-        Assert.Equal (new Rect (0, 0, 10, 1), btn.Bounds);
-        Assert.Equal (new Rect (0, 0, 10, 1), btn.Frame);
+        Assert.Equal (new Rectangle (0, 0, 10, 1), btn.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 10, 1), btn.Frame);
         Assert.Equal (KeyCode.T, btn.HotKey);
 
         btn = new Button { X = 1, Y = 2, Text = "_abc", IsDefault = true };
@@ -521,8 +521,8 @@ public class ButtonTests
 ";
         TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
 
-        Assert.Equal (new Rect (0, 0, 9, 1), btn.Bounds);
-        Assert.Equal (new Rect (1, 2, 9, 1), btn.Frame);
+        Assert.Equal (new Rectangle (0, 0, 9, 1), btn.Bounds);
+        Assert.Equal (new Rectangle (1, 2, 9, 1), btn.Frame);
     }
 
     [Fact]
@@ -762,7 +762,7 @@ public class ButtonTests
         Assert.True (btn.IsInitialized);
         Assert.Equal ("Say Hello 你", btn.Text);
         Assert.Equal ($"{CM.Glyphs.LeftBracket} {btn.Text} {CM.Glyphs.RightBracket}", btn.TextFormatter.Text);
-        Assert.Equal (new Rect (0, 0, 16, 1), btn.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 16, 1), btn.Bounds);
         var btnTxt = $"{CM.Glyphs.LeftBracket} {btn.Text} {CM.Glyphs.RightBracket}";
 
         var expected = @$"
@@ -775,8 +775,8 @@ public class ButtonTests
 └────────────────────────────┘
 ";
 
-        Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (0, 0, 30, 5), pos);
+        Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
+        Assert.Equal (new Rectangle (0, 0, 30, 5), pos);
     }
 
     [Fact]
@@ -799,7 +799,7 @@ public class ButtonTests
         Assert.True (btn.IsInitialized);
         Assert.Equal ("Say Hello 你", btn.Text);
         Assert.Equal ($"{CM.Glyphs.LeftBracket} {btn.Text} {CM.Glyphs.RightBracket}", btn.TextFormatter.Text);
-        Assert.Equal (new Rect (0, 0, 16, 1), btn.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 16, 1), btn.Bounds);
         var btnTxt = $"{CM.Glyphs.LeftBracket} {btn.Text} {CM.Glyphs.RightBracket}";
 
         var expected = @$"
@@ -812,7 +812,7 @@ public class ButtonTests
 └────────────────────────────┘
 ";
 
-        Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (0, 0, 30, 5), pos);
+        Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
+        Assert.Equal (new Rectangle (0, 0, 30, 5), pos);
     }
 }

+ 32 - 32
UnitTests/Views/CheckBoxTests.cs

@@ -1,4 +1,4 @@
-using System.ComponentModel;
+using System.ComponentModel;
 using Xunit.Abstractions;
 
 namespace Terminal.Gui.ViewsTests;
@@ -171,7 +171,7 @@ public class CheckBoxTests
         ((FakeDriver)Application.Driver).SetBufferSize (30, 5);
 
         Assert.True (checkBox.IsInitialized);
-        Assert.Equal (new Rect (1, 1, 19, 1), checkBox.Frame);
+        Assert.Equal (new Rectangle (1, 1, 19, 1), checkBox.Frame);
         Assert.Equal ("Check this out 你", checkBox.Text);
         Assert.Equal ($"{CM.Glyphs.UnChecked} Check this out 你", checkBox.TextFormatter.Text);
         Assert.True (checkBox.AutoSize);
@@ -188,7 +188,7 @@ public class CheckBoxTests
         Application.RunIteration (ref runstate, ref firstIteration);
 
         // BUGBUG - v2 - Autosize is busted; disabling tests for now
-        Assert.Equal (new Rect (1, 1, 19, 1), checkBox.Frame);
+        Assert.Equal (new Rectangle (1, 1, 19, 1), checkBox.Frame);
 
         var expected = @"
 ┌┤Test Demo 你├──────────────┐
@@ -197,8 +197,8 @@ public class CheckBoxTests
 │                            │
 └────────────────────────────┘";
 
-        Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (0, 0, 30, 5), pos);
+        Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
+        Assert.Equal (new Rectangle (0, 0, 30, 5), pos);
 
         checkBox.Width = 19;
 
@@ -206,7 +206,7 @@ public class CheckBoxTests
         checkBox.Text = "Check this out 你 changed";
         Application.RunIteration (ref runstate, ref firstIteration);
         Assert.False (checkBox.AutoSize);
-        Assert.Equal (new Rect (1, 1, 19, 1), checkBox.Frame);
+        Assert.Equal (new Rectangle (1, 1, 19, 1), checkBox.Frame);
 
         expected = @"
 ┌┤Test Demo 你├──────────────┐
@@ -216,11 +216,11 @@ public class CheckBoxTests
 └────────────────────────────┘";
 
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (0, 0, 30, 5), pos);
+        Assert.Equal (new Rectangle (0, 0, 30, 5), pos);
 
         checkBox.AutoSize = true;
         Application.RunIteration (ref runstate, ref firstIteration);
-        Assert.Equal (new Rect (1, 1, 27, 1), checkBox.Frame);
+        Assert.Equal (new Rectangle (1, 1, 27, 1), checkBox.Frame);
 
         expected = @"
 ┌┤Test Demo 你├──────────────┐
@@ -230,7 +230,7 @@ public class CheckBoxTests
 └────────────────────────────┘";
 
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (0, 0, 30, 5), pos);
+        Assert.Equal (new Rectangle (0, 0, 30, 5), pos);
     }
 
     [Fact]
@@ -243,7 +243,7 @@ public class CheckBoxTests
         Assert.Equal (string.Empty, ckb.Text);
         Assert.Equal ($"{CM.Glyphs.UnChecked} ", ckb.TextFormatter.Text);
         Assert.True (ckb.CanFocus);
-        Assert.Equal (new Rect (0, 0, 2, 1), ckb.Frame);
+        Assert.Equal (new Rectangle (0, 0, 2, 1), ckb.Frame);
 
         ckb = new CheckBox { Text = "Test", Checked = true };
         Assert.True (ckb.AutoSize);
@@ -252,7 +252,7 @@ public class CheckBoxTests
         Assert.Equal ("Test", ckb.Text);
         Assert.Equal ($"{CM.Glyphs.Checked} Test", ckb.TextFormatter.Text);
         Assert.True (ckb.CanFocus);
-        Assert.Equal (new Rect (0, 0, 6, 1), ckb.Frame);
+        Assert.Equal (new Rectangle (0, 0, 6, 1), ckb.Frame);
 
         ckb = new CheckBox { Text = "Test", X = 1, Y = 2 };
         Assert.True (ckb.AutoSize);
@@ -261,7 +261,7 @@ public class CheckBoxTests
         Assert.Equal ("Test", ckb.Text);
         Assert.Equal ($"{CM.Glyphs.UnChecked} Test", ckb.TextFormatter.Text);
         Assert.True (ckb.CanFocus);
-        Assert.Equal (new Rect (1, 2, 6, 1), ckb.Frame);
+        Assert.Equal (new Rectangle (1, 2, 6, 1), ckb.Frame);
 
         ckb = new CheckBox { Text = "Test", X = 3, Y = 4, Checked = true };
         Assert.True (ckb.AutoSize);
@@ -270,7 +270,7 @@ public class CheckBoxTests
         Assert.Equal ("Test", ckb.Text);
         Assert.Equal ($"{CM.Glyphs.Checked} Test", ckb.TextFormatter.Text);
         Assert.True (ckb.CanFocus);
-        Assert.Equal (new Rect (3, 4, 6, 1), ckb.Frame);
+        Assert.Equal (new Rectangle (3, 4, 6, 1), ckb.Frame);
     }
 
     [Fact]
@@ -360,7 +360,7 @@ public class CheckBoxTests
         ((FakeDriver)Application.Driver).SetBufferSize (30, 5);
 
         Assert.Equal (TextAlignment.Centered, checkBox.TextAlignment);
-        Assert.Equal (new Rect (1, 1, 25, 1), checkBox.Frame);
+        Assert.Equal (new Rectangle (1, 1, 25, 1), checkBox.Frame);
         Assert.Equal (new Size (25, 1), checkBox.TextFormatter.Size);
         Assert.False (checkBox.AutoSize);
 
@@ -372,8 +372,8 @@ public class CheckBoxTests
 └────────────────────────────┘
 ";
 
-        Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (0, 0, 30, 5), pos);
+        Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
+        Assert.Equal (new Rectangle (0, 0, 30, 5), pos);
 
         checkBox.Checked = true;
         Application.Refresh ();
@@ -387,7 +387,7 @@ public class CheckBoxTests
 ";
 
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (0, 0, 30, 5), pos);
+        Assert.Equal (new Rectangle (0, 0, 30, 5), pos);
     }
 
     [Fact]
@@ -421,10 +421,10 @@ public class CheckBoxTests
         ((FakeDriver)Application.Driver).SetBufferSize (30, 6);
 
         Assert.Equal (TextAlignment.Justified, checkBox1.TextAlignment);
-        Assert.Equal (new Rect (1, 1, 25, 1), checkBox1.Frame);
+        Assert.Equal (new Rectangle (1, 1, 25, 1), checkBox1.Frame);
         Assert.Equal (new Size (25, 1), checkBox1.TextFormatter.Size);
         Assert.Equal (TextAlignment.Justified, checkBox2.TextAlignment);
-        Assert.Equal (new Rect (1, 2, 25, 1), checkBox2.Frame);
+        Assert.Equal (new Rectangle (1, 2, 25, 1), checkBox2.Frame);
         Assert.Equal (new Size (25, 1), checkBox2.TextFormatter.Size);
 
         var expected = @$"
@@ -436,14 +436,14 @@ public class CheckBoxTests
 └────────────────────────────┘
 ";
 
-        Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (0, 0, 30, 6), pos);
+        Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
+        Assert.Equal (new Rectangle (0, 0, 30, 6), pos);
 
         checkBox1.Checked = true;
-        Assert.Equal (new Rect (1, 1, 25, 1), checkBox1.Frame);
+        Assert.Equal (new Rectangle (1, 1, 25, 1), checkBox1.Frame);
         Assert.Equal (new Size (25, 1), checkBox1.TextFormatter.Size);
         checkBox2.Checked = true;
-        Assert.Equal (new Rect (1, 2, 25, 1), checkBox2.Frame);
+        Assert.Equal (new Rectangle (1, 2, 25, 1), checkBox2.Frame);
         Assert.Equal (new Size (25, 1), checkBox2.TextFormatter.Size);
         Application.Refresh ();
 
@@ -457,7 +457,7 @@ public class CheckBoxTests
 ";
 
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (0, 0, 30, 6), pos);
+        Assert.Equal (new Rectangle (0, 0, 30, 6), pos);
     }
 
     [Fact]
@@ -480,7 +480,7 @@ public class CheckBoxTests
         ((FakeDriver)Application.Driver).SetBufferSize (30, 5);
 
         Assert.Equal (TextAlignment.Left, checkBox.TextAlignment);
-        Assert.Equal (new Rect (1, 1, 25, 1), checkBox.Frame);
+        Assert.Equal (new Rectangle (1, 1, 25, 1), checkBox.Frame);
         Assert.Equal (new Size (25, 1), checkBox.TextFormatter.Size);
 
         var expected = @$"
@@ -491,8 +491,8 @@ public class CheckBoxTests
 └────────────────────────────┘
 ";
 
-        Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (0, 0, 30, 5), pos);
+        Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
+        Assert.Equal (new Rectangle (0, 0, 30, 5), pos);
 
         checkBox.Checked = true;
         Application.Refresh ();
@@ -506,7 +506,7 @@ public class CheckBoxTests
 ";
 
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (0, 0, 30, 5), pos);
+        Assert.Equal (new Rectangle (0, 0, 30, 5), pos);
     }
 
     [Fact]
@@ -530,7 +530,7 @@ public class CheckBoxTests
         ((FakeDriver)Application.Driver).SetBufferSize (30, 5);
 
         Assert.Equal (TextAlignment.Right, checkBox.TextAlignment);
-        Assert.Equal (new Rect (1, 1, 25, 1), checkBox.Frame);
+        Assert.Equal (new Rectangle (1, 1, 25, 1), checkBox.Frame);
         Assert.Equal (new Size (25, 1), checkBox.TextFormatter.Size);
         Assert.False (checkBox.AutoSize);
 
@@ -542,8 +542,8 @@ public class CheckBoxTests
 └────────────────────────────┘
 ";
 
-        Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (0, 0, 30, 5), pos);
+        Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
+        Assert.Equal (new Rectangle (0, 0, 30, 5), pos);
 
         checkBox.Checked = true;
         Application.Refresh ();
@@ -557,7 +557,7 @@ public class CheckBoxTests
 ";
 
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (0, 0, 30, 5), pos);
+        Assert.Equal (new Rectangle (0, 0, 30, 5), pos);
     }
 
     [Fact]

+ 1 - 1
UnitTests/Views/ColorPickerTests.cs

@@ -13,7 +13,7 @@ public class ColorPickerTests
         colorPicker.BeginInit ();
         colorPicker.EndInit ();
         colorPicker.LayoutSubviews ();
-        Assert.Equal (new Rect (0, 0, 32, 4), colorPicker.Frame);
+        Assert.Equal (new Rectangle (0, 0, 32, 4), colorPicker.Frame);
     }
 
     [Fact]

+ 5 - 5
UnitTests/Views/ComboBoxTests.cs

@@ -21,7 +21,7 @@ public class ComboBoxTests
         Assert.Equal ("Two", cb.Text);
         Assert.NotNull (cb.Source);
         Assert.False (cb.AutoSize);
-        Assert.Equal (new Rect (0, 0, 0, 2), cb.Frame);
+        Assert.Equal (new Rectangle (0, 0, 0, 2), cb.Frame);
         Assert.Equal (1, cb.SelectedItem);
     }
 
@@ -36,7 +36,7 @@ public class ComboBoxTests
         Assert.Equal (string.Empty, cb.Text);
         Assert.Null (cb.Source);
         Assert.False (cb.AutoSize);
-        Assert.Equal (new Rect (0, 0, 0, 2), cb.Frame);
+        Assert.Equal (new Rectangle (0, 0, 0, 2), cb.Frame);
         Assert.Equal (-1, cb.SelectedItem);
 
         cb = new ComboBox { Text = "Test" };
@@ -46,7 +46,7 @@ public class ComboBoxTests
         Assert.Equal ("Test", cb.Text);
         Assert.Null (cb.Source);
         Assert.False (cb.AutoSize);
-        Assert.Equal (new Rect (0, 0, 0, 2), cb.Frame);
+        Assert.Equal (new Rectangle (0, 0, 0, 2), cb.Frame);
         Assert.Equal (-1, cb.SelectedItem);
 
         cb = new ComboBox
@@ -63,7 +63,7 @@ public class ComboBoxTests
         Assert.Equal (string.Empty, cb.Text);
         Assert.NotNull (cb.Source);
         Assert.False (cb.AutoSize);
-        Assert.Equal (new Rect (1, 2, 10, 20), cb.Frame);
+        Assert.Equal (new Rectangle (1, 2, 10, 20), cb.Frame);
         Assert.Equal (-1, cb.SelectedItem);
 
         cb = new ComboBox { Source = new ListWrapper (new List<string> { "One", "Two", "Three" }) };
@@ -73,7 +73,7 @@ public class ComboBoxTests
         Assert.Equal (string.Empty, cb.Text);
         Assert.NotNull (cb.Source);
         Assert.False (cb.AutoSize);
-        Assert.Equal (new Rect (0, 0, 0, 2), cb.Frame);
+        Assert.Equal (new Rectangle (0, 0, 0, 2), cb.Frame);
         Assert.Equal (-1, cb.SelectedItem);
     }
 

+ 31 - 31
UnitTests/Views/ContextMenuTests.cs

@@ -146,7 +146,7 @@ public class ContextMenuTests
         ((FakeDriver)Application.Driver).SetBufferSize (45, 17);
         Application.Begin (Application.Top);
 
-        Assert.Equal (new Rect (9, 3, 20, 1), tf.Frame);
+        Assert.Equal (new Rectangle (9, 3, 20, 1), tf.Frame);
         Assert.True (tf.HasFocus);
 
         tf.ContextMenu.Show ();
@@ -174,8 +174,8 @@ public class ContextMenuTests
  F1 Help │ ^Q Quit              
 ";
 
-        Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (1, 0, 32, 17), pos);
+        Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
+        Assert.Equal (new Rectangle (1, 0, 32, 17), pos);
     }
 
     [Fact]
@@ -212,7 +212,7 @@ public class ContextMenuTests
         Application.Begin (Application.Top);
         ((FakeDriver)Application.Driver).SetBufferSize (44, 17);
 
-        Assert.Equal (new Rect (9, 3, 20, 1), tf.Frame);
+        Assert.Equal (new Rectangle (9, 3, 20, 1), tf.Frame);
         Assert.True (tf.HasFocus);
 
         tf.ContextMenu.Show ();
@@ -240,8 +240,8 @@ public class ContextMenuTests
  F1 Help │ ^Q Quit                          
 ";
 
-        Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (1, 0, 44, 17), pos);
+        Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
+        Assert.Equal (new Rectangle (1, 0, 44, 17), pos);
     }
 
     [Fact]
@@ -250,14 +250,14 @@ public class ContextMenuTests
     {
         ((FakeDriver)Application.Driver).SetBufferSize (20, 15);
 
-        Assert.Equal (new Rect (0, 0, 20, 15), Application.Driver.Clip);
+        Assert.Equal (new Rectangle (0, 0, 20, 15), Application.Driver.Clip);
         TestHelpers.AssertDriverContentsWithFrameAre ("", _output);
 
         var top = new Toplevel { X = 2, Y = 2, Width = 15, Height = 4 };
         top.Add (new TextField { X = Pos.Center (), Width = 10, Text = "Test" });
         RunState rs = Application.Begin (top);
 
-        Assert.Equal (new Rect (2, 2, 15, 4), top.Frame);
+        Assert.Equal (new Rectangle (2, 2, 15, 4), top.Frame);
         Assert.Equal (top, Application.Top);
 
         TestHelpers.AssertDriverContentsWithFrameAre (
@@ -303,7 +303,7 @@ public class ContextMenuTests
         Application.Begin (top);
         ((FakeDriver)Application.Driver).SetBufferSize (20, 15);
 
-        Assert.Equal (new Rect (0, 0, 20, 15), win.Frame);
+        Assert.Equal (new Rectangle (0, 0, 20, 15), win.Frame);
 
         TestHelpers.AssertDriverContentsWithFrameAre (
                                                       @"
@@ -330,7 +330,7 @@ public class ContextMenuTests
         dialog.Add (new TextField { X = Pos.Center (), Width = 10, Text = "Test" });
         RunState rs = Application.Begin (dialog);
 
-        Assert.Equal (new Rect (2, 2, 15, 4), dialog.Frame);
+        Assert.Equal (new Rectangle (2, 2, 15, 4), dialog.Frame);
 
         TestHelpers.AssertDriverContentsWithFrameAre (
                                                       @"
@@ -390,7 +390,7 @@ public class ContextMenuTests
     {
         ((FakeDriver)Application.Driver).SetBufferSize (20, 15);
 
-        Assert.Equal (new Rect (0, 0, 20, 15), Application.Driver.Clip);
+        Assert.Equal (new Rectangle (0, 0, 20, 15), Application.Driver.Clip);
         TestHelpers.AssertDriverContentsWithFrameAre ("", _output);
 
         // Don't use Dialog here as it has more layout logic. Use Window instead.
@@ -398,7 +398,7 @@ public class ContextMenuTests
         dialog.Add (new TextField { X = Pos.Center (), Width = 10, Text = "Test" });
         RunState rs = Application.Begin (dialog);
 
-        Assert.Equal (new Rect (2, 2, 15, 4), dialog.Frame);
+        Assert.Equal (new Rectangle (2, 2, 15, 4), dialog.Frame);
         Assert.Equal (dialog, Application.Top);
 
         TestHelpers.AssertDriverContentsWithFrameAre (
@@ -466,8 +466,8 @@ public class ContextMenuTests
 └──────┘
 ";
 
-        Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (0, 1, 8, 4), pos);
+        Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
+        Assert.Equal (new Rectangle (0, 1, 8, 4), pos);
 
         cm.ForceMinimumPosToZero = false;
         cm.Show ();
@@ -481,7 +481,7 @@ public class ContextMenuTests
 ";
 
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (1, 0, 7, 3), pos);
+        Assert.Equal (new Rectangle (1, 0, 7, 3), pos);
     }
 
     [Fact]
@@ -1034,8 +1034,8 @@ public class ContextMenuTests
 │ One  │
 │ Two  │";
 
-        Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (0, 0, 8, 3), pos);
+        Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
+        Assert.Equal (new Rectangle (0, 0, 8, 3), pos);
 
         cm.Hide ();
         Assert.Equal (new Point (0, 0), cm.Position);
@@ -1070,8 +1070,8 @@ public class ContextMenuTests
 │ Two
 └────";
 
-        Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (0, 1, 5, 4), pos);
+        Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
+        Assert.Equal (new Rectangle (0, 1, 5, 4), pos);
 
         cm.Hide ();
         Assert.Equal (new Point (0, 0), cm.Position);
@@ -1119,8 +1119,8 @@ public class ContextMenuTests
           └──────┘
 ";
 
-        Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (10, 5, 18, 5), pos);
+        Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
+        Assert.Equal (new Rectangle (10, 5, 18, 5), pos);
 
         cm.Hide ();
         Assert.Equal (new Point (10, 5), cm.Position);
@@ -1143,7 +1143,7 @@ public class ContextMenuTests
 ";
 
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (5, 10, 13, 7), pos);
+        Assert.Equal (new Rectangle (5, 10, 13, 7), pos);
 
         cm.Hide ();
         Assert.Equal (new Point (5, 12), cm.Position);
@@ -1177,8 +1177,8 @@ public class ContextMenuTests
                                                                         └──────┘
 ";
 
-        Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (72, 21, 80, 4), pos);
+        Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
+        Assert.Equal (new Rectangle (72, 21, 80, 4), pos);
 
         cm.Hide ();
         Assert.Equal (new Point (80, 25), cm.Position);
@@ -1211,7 +1211,7 @@ public class ContextMenuTests
         Application.Top.Add (view);
         Application.Begin (Application.Top);
 
-        Assert.Equal (new Rect (70, 24, 10, 1), view.Frame);
+        Assert.Equal (new Rectangle (70, 24, 10, 1), view.Frame);
         Assert.Equal (Point.Empty, cm.Position);
 
         cm.Show ();
@@ -1226,8 +1226,8 @@ public class ContextMenuTests
                                                                       View    
 ";
 
-        Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (70, 20, 78, 5), pos);
+        Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
+        Assert.Equal (new Rectangle (70, 20, 78, 5), pos);
 
         cm.Hide ();
         Assert.Equal (new Point (70, 24), cm.Position);
@@ -1294,7 +1294,7 @@ public class ContextMenuTests
         cm.Show ();
         RunState rs = Application.Begin (Application.Top);
 
-        Assert.Equal (new Rect (5, 11, 10, 5), Application.Top.Subviews [0].Frame);
+        Assert.Equal (new Rectangle (5, 11, 10, 5), Application.Top.Subviews [0].Frame);
 
         TestHelpers.AssertDriverContentsWithFrameAre (
                                                       @"
@@ -1314,8 +1314,8 @@ public class ContextMenuTests
 
         var firstIteration = false;
         Application.RunIteration (ref rs, ref firstIteration);
-        Assert.Equal (new Rect (5, 11, 10, 5), Application.Top.Subviews [0].Frame);
-        Assert.Equal (new Rect (5, 11, 15, 6), Application.Top.Subviews [1].Frame);
+        Assert.Equal (new Rectangle (5, 11, 10, 5), Application.Top.Subviews [0].Frame);
+        Assert.Equal (new Rectangle (5, 11, 15, 6), Application.Top.Subviews [1].Frame);
 
         TestHelpers.AssertDriverContentsWithFrameAre (
                                                       @"
@@ -1336,7 +1336,7 @@ public class ContextMenuTests
 
         firstIteration = false;
         Application.RunIteration (ref rs, ref firstIteration);
-        Assert.Equal (new Rect (5, 11, 10, 5), Application.Top.Subviews [0].Frame);
+        Assert.Equal (new Rectangle (5, 11, 10, 5), Application.Top.Subviews [0].Frame);
 
         TestHelpers.AssertDriverContentsWithFrameAre (
                                                       @"

+ 3 - 3
UnitTests/Views/DateFieldTests.cs

@@ -11,20 +11,20 @@ public class DateFieldTests
         var df = new DateField ();
         Assert.Equal (DateTime.MinValue, df.Date);
         Assert.Equal (1, df.CursorPosition);
-        Assert.Equal (new Rect (0, 0, 12, 1), df.Frame);
+        Assert.Equal (new Rectangle (0, 0, 12, 1), df.Frame);
         Assert.Equal (" 01/01/0001", df.Text);
 
         DateTime date = DateTime.Now;
         df = new DateField (date);
         Assert.Equal (date, df.Date);
         Assert.Equal (1, df.CursorPosition);
-        Assert.Equal (new Rect (0, 0, 12, 1), df.Frame);
+        Assert.Equal (new Rectangle (0, 0, 12, 1), df.Frame);
         Assert.Equal ($" {date.ToString (CultureInfo.InvariantCulture.DateTimeFormat.ShortDatePattern)}", df.Text);
 
         df = new DateField (date) { X = 1, Y = 2 };
         Assert.Equal (date, df.Date);
         Assert.Equal (1, df.CursorPosition);
-        Assert.Equal (new Rect (1, 2, 12, 1), df.Frame);
+        Assert.Equal (new Rectangle (1, 2, 12, 1), df.Frame);
         Assert.Equal ($" {date.ToString (CultureInfo.InvariantCulture.DateTimeFormat.ShortDatePattern)}", df.Text);
     }
 

+ 6 - 6
UnitTests/Views/FrameViewTests.cs

@@ -33,7 +33,7 @@ public class FrameViewTests
         fv.BeginInit ();
         fv.EndInit ();
         Assert.Equal (LineStyle.Single, fv.BorderStyle);
-        Assert.Equal (new Rect (1, 2, 10, 20), fv.Frame);
+        Assert.Equal (new Rectangle (1, 2, 10, 20), fv.Frame);
     }
 
     [Fact]
@@ -46,12 +46,12 @@ public class FrameViewTests
         Assert.Equal (string.Empty, fv.Text);
         Application.Top.Add (fv);
         Application.Begin (Application.Top);
-        Assert.Equal (new Rect (0, 0, 0, 0), fv.Frame);
+        Assert.Equal (new Rectangle (0, 0, 0, 0), fv.Frame);
         TestHelpers.AssertDriverContentsWithFrameAre (@"", _output);
 
         fv.Height = 5;
         fv.Width = 5;
-        Assert.Equal (new Rect (0, 0, 5, 5), fv.Frame);
+        Assert.Equal (new Rectangle (0, 0, 5, 5), fv.Frame);
         Application.Refresh ();
 
         TestHelpers.AssertDriverContentsWithFrameAre (
@@ -66,7 +66,7 @@ public class FrameViewTests
 
         fv.X = 1;
         fv.Y = 2;
-        Assert.Equal (new Rect (1, 2, 5, 5), fv.Frame);
+        Assert.Equal (new Rectangle (1, 2, 5, 5), fv.Frame);
         Application.Refresh ();
 
         TestHelpers.AssertDriverContentsWithFrameAre (
@@ -81,7 +81,7 @@ public class FrameViewTests
 
         fv.X = -1;
         fv.Y = -2;
-        Assert.Equal (new Rect (-1, -2, 5, 5), fv.Frame);
+        Assert.Equal (new Rectangle (-1, -2, 5, 5), fv.Frame);
         Application.Refresh ();
 
         TestHelpers.AssertDriverContentsWithFrameAre (
@@ -94,7 +94,7 @@ public class FrameViewTests
 
         fv.X = 7;
         fv.Y = 8;
-        Assert.Equal (new Rect (7, 8, 5, 5), fv.Frame);
+        Assert.Equal (new Rectangle (7, 8, 5, 5), fv.Frame);
         Application.Refresh ();
 
         TestHelpers.AssertDriverContentsWithFrameAre (

+ 34 - 34
UnitTests/Views/GraphViewTests.cs

@@ -61,7 +61,7 @@ public class GraphViewTests
         gv.EndInit ();
 
         gv.ColorScheme = new ColorScheme ();
-        gv.Bounds = new Rect (0, 0, 50, 30);
+        gv.Bounds = new Rectangle (0, 0, 50, 30);
         gv.Series.Add (new ScatterSeries { Points = new List<PointF> { new (1, 1) } });
         gv.CellSize = new PointF (0, 5);
         var ex = Assert.Throws<Exception> (() => gv.Draw ());
@@ -85,7 +85,7 @@ public class GraphViewTests
         gv.ColorScheme = new ColorScheme ();
         gv.MarginBottom = 1;
         gv.MarginLeft = 1;
-        gv.Bounds = new Rect (0, 0, 10, 5);
+        gv.Bounds = new Rectangle (0, 0, 10, 5);
 
         return gv;
     }
@@ -128,7 +128,7 @@ public class GraphViewTests
         var gv = new GraphView ();
         gv.BeginInit ();
         gv.EndInit ();
-        gv.Bounds = new Rect (0, 0, 50, 30);
+        gv.Bounds = new Rectangle (0, 0, 50, 30);
 
         // How much graph space each cell of the console depicts
         gv.CellSize = new PointF (0.1f, 0.25f);
@@ -199,7 +199,7 @@ public class GraphViewTests
         gv.BeginInit ();
         gv.EndInit ();
 
-        gv.Bounds = new Rect (0, 0, 20, 10);
+        gv.Bounds = new Rectangle (0, 0, 20, 10);
 
         // origin should be bottom left
         RectangleF botLeft = gv.ScreenToGraphSpace (0, 9);
@@ -221,7 +221,7 @@ public class GraphViewTests
         gv.BeginInit ();
         gv.EndInit ();
 
-        gv.Bounds = new Rect (0, 0, 20, 10);
+        gv.Bounds = new Rectangle (0, 0, 20, 10);
 
         // origin should be bottom left
         RectangleF botLeft = gv.ScreenToGraphSpace (0, 9);
@@ -261,7 +261,7 @@ public class GraphViewTests
         gv.BeginInit ();
         gv.EndInit ();
 
-        gv.Bounds = new Rect (0, 0, 20, 10);
+        gv.Bounds = new Rectangle (0, 0, 20, 10);
 
         // Each cell of screen measures 5 units in graph data model vertically and 1/4 horizontally
         gv.CellSize = new PointF (0.25f, 5);
@@ -293,7 +293,7 @@ public class GraphViewTests
         gv.BeginInit ();
         gv.EndInit ();
 
-        gv.Bounds = new Rect (0, 0, 20, 10);
+        gv.Bounds = new Rectangle (0, 0, 20, 10);
 
         // origin should be bottom left
         Point botLeft = gv.GraphSpaceToScreen (new PointF (0, 0));
@@ -313,7 +313,7 @@ public class GraphViewTests
         gv.BeginInit ();
         gv.EndInit ();
 
-        gv.Bounds = new Rect (0, 0, 20, 10);
+        gv.Bounds = new Rectangle (0, 0, 20, 10);
 
         // origin should be bottom left
         Point botLeft = gv.GraphSpaceToScreen (new PointF (0, 0));
@@ -343,7 +343,7 @@ public class GraphViewTests
         gv.BeginInit ();
         gv.EndInit ();
 
-        gv.Bounds = new Rect (0, 0, 20, 10);
+        gv.Bounds = new Rectangle (0, 0, 20, 10);
 
         //graph is scrolled to present chart space -5 to 5 in both axes
         gv.ScrollOffset = new PointF (-5, -5);
@@ -366,7 +366,7 @@ public class GraphViewTests
         gv.BeginInit ();
         gv.EndInit ();
 
-        gv.Bounds = new Rect (0, 0, 20, 10);
+        gv.Bounds = new Rectangle (0, 0, 20, 10);
 
         // Each cell of screen is responsible for rendering 5 units in graph data model
         // vertically and 1/4 horizontally
@@ -407,7 +407,7 @@ public class GraphViewTests
         gv.BeginInit ();
         gv.EndInit ();
 
-        gv.Bounds = new Rect (0, 0, 20, 10);
+        gv.Bounds = new Rectangle (0, 0, 20, 10);
 
         // Each cell of screen is responsible for rendering 5 units in graph data model
         // vertically and 1/4 horizontally
@@ -449,10 +449,10 @@ public class SeriesTests
         gv.BeginInit ();
         gv.EndInit ();
         gv.ColorScheme = new ColorScheme ();
-        gv.Bounds = new Rect (0, 0, 50, 30);
+        gv.Bounds = new Rectangle (0, 0, 50, 30);
 
         var fullGraphBounds = RectangleF.Empty;
-        var graphScreenBounds = Rect.Empty;
+        var graphScreenBounds = Rectangle.Empty;
 
         var series = new FakeSeries (
                                      (v, s, g) =>
@@ -466,7 +466,7 @@ public class SeriesTests
         gv.LayoutSubviews ();
         gv.Draw ();
         Assert.Equal (new RectangleF (0, 0, 50, 30), fullGraphBounds);
-        Assert.Equal (new Rect (0, 0, 50, 30), graphScreenBounds);
+        Assert.Equal (new Rectangle (0, 0, 50, 30), graphScreenBounds);
 
         // Now we put a margin in
         // Graph should not spill into the margins
@@ -482,7 +482,7 @@ public class SeriesTests
 
         // The screen space the graph will be rendered into should
         // not overspill the margins
-        Assert.Equal (new Rect (5, 0, 45, 28), graphScreenBounds);
+        Assert.Equal (new Rectangle (5, 0, 45, 28), graphScreenBounds);
 
         // Shutdown must be called to safely clean up Application if Init has been called
         Application.Shutdown ();
@@ -501,13 +501,13 @@ public class SeriesTests
         gv.BeginInit ();
         gv.EndInit ();
         gv.ColorScheme = new ColorScheme ();
-        gv.Bounds = new Rect (0, 0, 50, 30);
+        gv.Bounds = new Rectangle (0, 0, 50, 30);
 
         // the larger the cell size the more condensed (smaller) the graph space is
         gv.CellSize = new PointF (2, 5);
 
         var fullGraphBounds = RectangleF.Empty;
-        var graphScreenBounds = Rect.Empty;
+        var graphScreenBounds = Rectangle.Empty;
 
         var series = new FakeSeries (
                                      (v, s, g) =>
@@ -525,7 +525,7 @@ public class SeriesTests
         // Since each cell of the console is 2x5 of graph space the graph
         // bounds to be rendered are larger
         Assert.Equal (new RectangleF (0, 0, 100, 150), fullGraphBounds);
-        Assert.Equal (new Rect (0, 0, 50, 30), graphScreenBounds);
+        Assert.Equal (new Rectangle (0, 0, 50, 30), graphScreenBounds);
 
         // Graph should not spill into the margins
 
@@ -540,7 +540,7 @@ public class SeriesTests
 
         // The screen space the graph will be rendered into should
         // not overspill the margins
-        Assert.Equal (new Rect (5, 0, 45, 28), graphScreenBounds);
+        Assert.Equal (new Rectangle (5, 0, 45, 28), graphScreenBounds);
 
         // Shutdown must be called to safely clean up Application if Init has been called
         Application.Shutdown ();
@@ -548,16 +548,16 @@ public class SeriesTests
 
     private class FakeSeries : ISeries
     {
-        private readonly Action<GraphView, Rect, RectangleF> _drawSeries;
+        private readonly Action<GraphView, Rectangle, RectangleF> _drawSeries;
 
         public FakeSeries (
-            Action<GraphView, Rect, RectangleF> drawSeries
+            Action<GraphView, Rectangle, RectangleF> drawSeries
         )
         {
             _drawSeries = drawSeries;
         }
 
-        public void DrawSeries (GraphView graph, Rect bounds, RectangleF graphBounds) { _drawSeries (graph, bounds, graphBounds); }
+        public void DrawSeries (GraphView graph, Rectangle bounds, RectangleF graphBounds) { _drawSeries (graph, bounds, graphBounds); }
     }
 }
 
@@ -641,7 +641,7 @@ public class MultiBarSeriesTests
 
         // y axis goes from 0.1 to 1 across 10 console rows
         // x axis goes from 0 to 20 across 20 console columns
-        gv.Bounds = new Rect (0, 0, 20, 10);
+        gv.Bounds = new Rectangle (0, 0, 20, 10);
         gv.CellSize = new PointF (1f, 0.1f);
         gv.MarginBottom = 1;
         gv.MarginLeft = 1;
@@ -873,7 +873,7 @@ public class BarSeriesTests
 
         // y axis goes from 0.1 to 1 across 10 console rows
         // x axis goes from 0 to 10 across 20 console columns
-        gv.Bounds = new Rect (0, 0, 20, 10);
+        gv.Bounds = new Rectangle (0, 0, 20, 10);
         gv.CellSize = new PointF (0.5f, 0.1f);
 
         gv.Series.Add (series = new FakeBarSeries ());
@@ -914,7 +914,7 @@ public class AxisTests
 
         var gv = new GraphView ();
         gv.ColorScheme = new ColorScheme ();
-        gv.Bounds = new Rect (0, 0, 50, 30);
+        gv.Bounds = new Rectangle (0, 0, 50, 30);
 
         // graph can't be completely empty or it won't draw
         gv.Series.Add (new ScatterSeries ());
@@ -1298,19 +1298,19 @@ public class LegendTests
     public void Constructors_Defaults ()
     {
         var legend = new LegendAnnotation ();
-        Assert.Equal (Rect.Empty, legend.Bounds);
-        Assert.Equal (Rect.Empty, legend.Frame);
+        Assert.Equal (Rectangle.Empty, legend.Bounds);
+        Assert.Equal (Rectangle.Empty, legend.Frame);
         Assert.Equal (LineStyle.Single, legend.BorderStyle);
         Assert.False (legend.BeforeSeries);
 
-        var bounds = new Rect (1, 2, 10, 3);
+        var bounds = new Rectangle (1, 2, 10, 3);
         legend = new LegendAnnotation (bounds);
-        Assert.Equal (new Rect (0, 0, 8, 1), legend.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 8, 1), legend.Bounds);
         Assert.Equal (bounds, legend.Frame);
         Assert.Equal (LineStyle.Single, legend.BorderStyle);
         Assert.False (legend.BeforeSeries);
         legend.BorderStyle = LineStyle.None;
-        Assert.Equal (new Rect (0, 0, 10, 3), legend.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 10, 3), legend.Bounds);
         Assert.Equal (bounds, legend.Frame);
     }
 
@@ -1318,7 +1318,7 @@ public class LegendTests
     public void LegendNormalUsage_WithBorder ()
     {
         GraphView gv = GraphViewTests.GetGraph ();
-        var legend = new LegendAnnotation (new Rect (2, 0, 5, 3));
+        var legend = new LegendAnnotation (new Rectangle (2, 0, 5, 3));
         legend.AddEntry (new GraphCellToRender ((Rune)'A'), "Ant");
         legend.AddEntry (new GraphCellToRender ((Rune)'B'), "Bat");
 
@@ -1343,7 +1343,7 @@ public class LegendTests
     public void LegendNormalUsage_WithoutBorder ()
     {
         GraphView gv = GraphViewTests.GetGraph ();
-        var legend = new LegendAnnotation (new Rect (2, 0, 5, 3));
+        var legend = new LegendAnnotation (new Rectangle (2, 0, 5, 3));
         legend.AddEntry (new GraphCellToRender ((Rune)'A'), "Ant");
         legend.AddEntry (new GraphCellToRender ((Rune)'B'), "?"); // this will exercise pad
         legend.AddEntry (new GraphCellToRender ((Rune)'C'), "Cat");
@@ -1549,7 +1549,7 @@ public class PathAnnotationTests
     public void XAxisLabels_With_MarginLeft ()
     {
         GraphViewTests.InitFakeDriver ();
-        var gv = new GraphView { ColorScheme = new ColorScheme (), Bounds = new Rect (0, 0, 10, 7) };
+        var gv = new GraphView { ColorScheme = new ColorScheme (), Bounds = new Rectangle (0, 0, 10, 7) };
 
         gv.CellSize = new PointF (1, 0.5f);
         gv.AxisY.Increment = 1;
@@ -1591,7 +1591,7 @@ public class PathAnnotationTests
     public void YAxisLabels_With_MarginBottom ()
     {
         GraphViewTests.InitFakeDriver ();
-        var gv = new GraphView { ColorScheme = new ColorScheme (), Bounds = new Rect (0, 0, 10, 7) };
+        var gv = new GraphView { ColorScheme = new ColorScheme (), Bounds = new Rectangle (0, 0, 10, 7) };
 
         gv.CellSize = new PointF (1, 0.5f);
         gv.AxisY.Increment = 1;

+ 26 - 26
UnitTests/Views/LabelTests.cs

@@ -191,7 +191,7 @@ public class LabelTests
         Assert.Equal (TextAlignment.Left, label.TextAlignment);
         Assert.True (label.AutoSize);
         Assert.False (label.CanFocus);
-        Assert.Equal (new Rect (0, 0, 0, 0), label.Frame);
+        Assert.Equal (new Rectangle (0, 0, 0, 0), label.Frame);
         Assert.Equal (KeyCode.Null, label.HotKey);
         var expected = @"";
         TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
@@ -204,7 +204,7 @@ public class LabelTests
         rs = Application.Begin (Application.Top);
 
         Assert.Equal ("Test", label.TextFormatter.Text);
-        Assert.Equal (new Rect (0, 0, 4, 1), label.Frame);
+        Assert.Equal (new Rectangle (0, 0, 4, 1), label.Frame);
 
         expected = @"
 Test
@@ -218,7 +218,7 @@ Test
         rs = Application.Begin (Application.Top);
 
         Assert.Equal ("Test", label.TextFormatter.Text);
-        Assert.Equal (new Rect (3, 4, 4, 1), label.Frame);
+        Assert.Equal (new Rectangle (3, 4, 4, 1), label.Frame);
 
         expected = @"
    Test
@@ -248,12 +248,12 @@ Test
         Assert.True (label.AutoSize);
 
         tf1.Draw (
-                  new Rect (new Point (0, 1), tf1Size),
+                  new Rectangle (new Point (0, 1), tf1Size),
                   label.GetNormalColor (),
                   label.ColorScheme.HotNormal
                  );
 
-        tf2.Draw (new Rect (new Point (0, 2), tf2Size), label.GetNormalColor (), label.ColorScheme.HotNormal);
+        tf2.Draw (new Rectangle (new Point (0, 2), tf2Size), label.GetNormalColor (), label.ColorScheme.HotNormal);
 
         TestHelpers.AssertDriverContentsWithFrameAre (
                                                       @"
@@ -270,13 +270,13 @@ This TextFormatter (tf2) with fill will be cleared on rewritten.
         tf1.Text = "This TextFormatter (tf1) is rewritten.";
 
         tf1.Draw (
-                  new Rect (new Point (0, 1), tf1Size),
+                  new Rectangle (new Point (0, 1), tf1Size),
                   label.GetNormalColor (),
                   label.ColorScheme.HotNormal
                  );
 
         tf2.Text = "This TextFormatter (tf2) is rewritten.";
-        tf2.Draw (new Rect (new Point (0, 2), tf2Size), label.GetNormalColor (), label.ColorScheme.HotNormal);
+        tf2.Draw (new Rectangle (new Point (0, 2), tf2Size), label.GetNormalColor (), label.ColorScheme.HotNormal);
 
         TestHelpers.AssertDriverContentsWithFrameAre (
                                                       @"
@@ -297,14 +297,14 @@ This TextFormatter (tf2) is rewritten.
         Application.Begin (Application.Top);
 
         Assert.True (label.AutoSize);
-        Assert.Equal (new Rect (0, 0, 16, 1), label.Frame);
+        Assert.Equal (new Rectangle (0, 0, 16, 1), label.Frame);
 
         var expected = @"
 Demo Simple Rune
 ";
 
-        Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (0, 0, 16, 1), pos);
+        Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
+        Assert.Equal (new Rectangle (0, 0, 16, 1), pos);
     }
 
     [Fact]
@@ -337,8 +337,8 @@ n
 e
 ";
 
-        Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (0, 0, 1, 16), pos);
+        Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
+        Assert.Equal (new Rectangle (0, 0, 1, 16), pos);
     }
 
     [Fact]
@@ -359,8 +359,8 @@ e
 ";
 
-        Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (0, 0, 2, 7), pos);
+        Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
+        Assert.Equal (new Rectangle (0, 0, 2, 7), pos);
     }
 
     [Fact]
@@ -437,7 +437,7 @@ e
         Assert.True (label.IsInitialized);
         Assert.Equal ("Say Hello 你", label.Text);
         Assert.Equal ("Say Hello 你", label.TextFormatter.Text);
-        Assert.Equal (new Rect (0, 0, 12, 1), label.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 12, 1), label.Bounds);
 
         var expected = @"
 ┌────────────────────────────┐
@@ -446,8 +446,8 @@ e
 │                            │
 └────────────────────────────┘
 ";
-        Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (0, 0, 30, 5), pos);
+        Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
+        Assert.Equal (new Rectangle (0, 0, 30, 5), pos);
     }
 
     [Fact]
@@ -467,7 +467,7 @@ e
         Assert.True (label.IsInitialized);
         Assert.Equal ("Say Hello 你", label.Text);
         Assert.Equal ("Say Hello 你", label.TextFormatter.Text);
-        Assert.Equal (new Rect (0, 0, 12, 1), label.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 12, 1), label.Bounds);
 
         var expected = @"
 ┌────────────────────────────┐
@@ -477,8 +477,8 @@ e
 └────────────────────────────┘
 ";
 
-        Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (0, 0, 30, 5), pos);
+        Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
+        Assert.Equal (new Rectangle (0, 0, 30, 5), pos);
     }
 
 
@@ -490,8 +490,8 @@ e
         Application.Top.Add (label);
         Application.Begin (Application.Top);
 
-        Assert.Equal (new Rect (0, 0, 6, 3), label.Frame);
-        Assert.Equal (new Rect (0, 0, 4, 1), label.Bounds);
+        Assert.Equal (new (0, 0, 6, 3), label.Frame);
+        Assert.Equal (new (0, 0, 4, 1), label.Bounds);
 
         TestHelpers.AssertDriverContentsWithFrameAre (
                                                       @"
@@ -512,8 +512,8 @@ e
         Application.Top.Add (label);
         Application.Begin (Application.Top);
 
-        Assert.Equal (new Rect (0, 0, 6, 3), label.Frame);
-        Assert.Equal (new Rect (0, 0, 4, 1), label.Bounds);
+        Assert.Equal (new (0, 0, 6, 3), label.Frame);
+        Assert.Equal (new (0, 0, 4, 1), label.Bounds);
         Application.Begin (Application.Top);
 
         TestHelpers.AssertDriverContentsWithFrameAre (
@@ -533,8 +533,8 @@ e
         Application.Top.Add (label);
         Application.Begin (Application.Top);
 
-        Assert.Equal (new Rect (0, 0, 6, 2), label.Frame);
-        Assert.Equal (new Rect (0, 0, 4, 1), label.Bounds);
+        Assert.Equal (new (0, 0, 6, 2), label.Frame);
+        Assert.Equal (new (0, 0, 4, 1), label.Bounds);
         Application.Begin (Application.Top);
 
         TestHelpers.AssertDriverContentsWithFrameAre (

+ 2 - 2
UnitTests/Views/ListViewTests.cs

@@ -31,12 +31,12 @@ public class ListViewTests
         };
         Assert.NotNull (lv.Source);
         Assert.Equal (-1, lv.SelectedItem);
-        Assert.Equal (new Rect (0, 1, 10, 20), lv.Frame);
+        Assert.Equal (new Rectangle (0, 1, 10, 20), lv.Frame);
 
         lv = new ListView { Y = 1, Width = 10, Height = 20, Source = new NewListDataSource () };
         Assert.NotNull (lv.Source);
         Assert.Equal (-1, lv.SelectedItem);
-        Assert.Equal (new Rect (0, 1, 10, 20), lv.Frame);
+        Assert.Equal (new Rectangle (0, 1, 10, 20), lv.Frame);
     }
 
     [Fact]

+ 42 - 42
UnitTests/Views/MenuBarTests.cs

@@ -368,7 +368,7 @@ public class MenuBarTests
         Application.Begin (top);
         ((FakeDriver)Application.Driver).SetBufferSize (40, 15);
 
-        Assert.Equal (new Rect (0, 0, 40, 15), win.Frame);
+        Assert.Equal (new Rectangle (0, 0, 40, 15), win.Frame);
 
         TestHelpers.AssertDriverContentsWithFrameAre (
                                                       @"
@@ -469,7 +469,7 @@ public class MenuBarTests
 
         RunState rs = Application.Begin (dialog);
 
-        Assert.Equal (new Rect (2, 2, 15, 4), dialog.Frame);
+        Assert.Equal (new Rectangle (2, 2, 15, 4), dialog.Frame);
 
         TestHelpers.AssertDriverContentsWithFrameAre (
                                                       @"
@@ -598,7 +598,7 @@ public class MenuBarTests
     {
         ((FakeDriver)Application.Driver).SetBufferSize (40, 15);
 
-        Assert.Equal (new Rect (0, 0, 40, 15), Application.Driver.Clip);
+        Assert.Equal (new Rectangle (0, 0, 40, 15), Application.Driver.Clip);
         TestHelpers.AssertDriverContentsWithFrameAre (@"", _output);
 
         List<string> items = new ()
@@ -680,7 +680,7 @@ public class MenuBarTests
 
         RunState rs = Application.Begin (dialog);
 
-        Assert.Equal (new Rect (2, 2, 15, 4), dialog.Frame);
+        Assert.Equal (new Rectangle (2, 2, 15, 4), dialog.Frame);
 
         TestHelpers.AssertDriverContentsWithFrameAre (
                                                       @"
@@ -797,11 +797,11 @@ public class MenuBarTests
 ──────┘
 ";
 
-        Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (0, 0, 7, 4), pos);
+        Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
+        Assert.Equal (new Rectangle (0, 0, 7, 4), pos);
 
         menu.CloseAllMenus ();
-        menu.Frame = new Rect (-1, -2, menu.Frame.Width, menu.Frame.Height);
+        menu.Frame = new Rectangle (-1, -2, menu.Frame.Width, menu.Frame.Height);
         menu.OpenMenu ();
         Application.Refresh ();
 
@@ -812,10 +812,10 @@ public class MenuBarTests
 ";
 
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (1, 0, 7, 3), pos);
+        Assert.Equal (new Rectangle (1, 0, 7, 3), pos);
 
         menu.CloseAllMenus ();
-        menu.Frame = new Rect (0, 0, menu.Frame.Width, menu.Frame.Height);
+        menu.Frame = new Rectangle (0, 0, menu.Frame.Width, menu.Frame.Height);
         ((FakeDriver)Application.Driver).SetBufferSize (7, 5);
         menu.OpenMenu ();
         Application.Refresh ();
@@ -828,10 +828,10 @@ public class MenuBarTests
 ";
 
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (0, 1, 7, 4), pos);
+        Assert.Equal (new Rectangle (0, 1, 7, 4), pos);
 
         menu.CloseAllMenus ();
-        menu.Frame = new Rect (0, 0, menu.Frame.Width, menu.Frame.Height);
+        menu.Frame = new Rectangle (0, 0, menu.Frame.Width, menu.Frame.Height);
         ((FakeDriver)Application.Driver).SetBufferSize (7, 3);
         menu.OpenMenu ();
         Application.Refresh ();
@@ -843,7 +843,7 @@ public class MenuBarTests
 ";
 
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (0, 0, 7, 3), pos);
+        Assert.Equal (new Rectangle (0, 0, 7, 3), pos);
     }
 
     [Fact]
@@ -874,7 +874,7 @@ wo
         _ = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
 
         menu.CloseAllMenus ();
-        menu.Frame = new Rect (-2, -2, menu.Frame.Width, menu.Frame.Height);
+        menu.Frame = new Rectangle (-2, -2, menu.Frame.Width, menu.Frame.Height);
         menu.OpenMenu ();
         Application.Refresh ();
 
@@ -885,7 +885,7 @@ wo
         _ = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
 
         menu.CloseAllMenus ();
-        menu.Frame = new Rect (0, 0, menu.Frame.Width, menu.Frame.Height);
+        menu.Frame = new Rectangle (0, 0, menu.Frame.Width, menu.Frame.Height);
         ((FakeDriver)Application.Driver).SetBufferSize (3, 2);
         menu.OpenMenu ();
         Application.Refresh ();
@@ -898,7 +898,7 @@ wo
         _ = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
 
         menu.CloseAllMenus ();
-        menu.Frame = new Rect (0, 0, menu.Frame.Width, menu.Frame.Height);
+        menu.Frame = new Rectangle (0, 0, menu.Frame.Width, menu.Frame.Height);
         ((FakeDriver)Application.Driver).SetBufferSize (3, 1);
         menu.OpenMenu ();
         Application.Refresh ();
@@ -934,8 +934,8 @@ wo
 └──────┘
 ";
 
-        Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (0, 1, 8, 4), pos);
+        Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
+        Assert.Equal (new Rectangle (0, 1, 8, 4), pos);
     }
 
     [Fact]
@@ -2833,7 +2833,7 @@ Edit
  Numbers
 ";
 
-        Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
+        Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
 
         Assert.True (menu.NewKeyDownEvent (menu.Key));
         Application.Top.Draw ();
@@ -2935,8 +2935,8 @@ Edit
  Numbers
 ";
 
-        Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (1, 0, 8, 1), pos);
+        Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
+        Assert.Equal (new Rectangle (1, 0, 8, 1), pos);
 
         Assert.True (
                      menu.MouseEvent (
@@ -2955,7 +2955,7 @@ Edit
 ";
 
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (1, 0, 10, 6), pos);
+        Assert.Equal (new Rectangle (1, 0, 10, 6), pos);
 
         Assert.False (
                       menu.MouseEvent (
@@ -2978,7 +2978,7 @@ Edit
 ";
 
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (1, 0, 25, 7), pos);
+        Assert.Equal (new Rectangle (1, 0, 25, 7), pos);
 
         Assert.False (
                       menu.MouseEvent (
@@ -3000,7 +3000,7 @@ Edit
 ";
 
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (1, 0, 10, 6), pos);
+        Assert.Equal (new Rectangle (1, 0, 10, 6), pos);
 
         Assert.False (
                       menu.MouseEvent (
@@ -3014,7 +3014,7 @@ Edit
 ";
 
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (1, 0, 8, 1), pos);
+        Assert.Equal (new Rectangle (1, 0, 8, 1), pos);
     }
 
     [Fact]
@@ -3132,8 +3132,8 @@ Edit
  Numbers
 ";
 
-        Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (1, 0, 8, 1), pos);
+        Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
+        Assert.Equal (new Rectangle (1, 0, 8, 1), pos);
 
         Assert.True (menu.NewKeyDownEvent (menu.Key));
         Application.Top.Draw ();
@@ -3148,7 +3148,7 @@ Edit
 ";
 
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (1, 0, 10, 6), pos);
+        Assert.Equal (new Rectangle (1, 0, 10, 6), pos);
 
         Assert.True (Application.Top.Subviews [1].NewKeyDownEvent (Key.CursorDown));
         Assert.True (Application.Top.Subviews [1].NewKeyDownEvent (Key.Enter));
@@ -3165,7 +3165,7 @@ Edit
 ";
 
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (1, 0, 15, 7), pos);
+        Assert.Equal (new Rectangle (1, 0, 15, 7), pos);
 
         Assert.True (Application.Top.Subviews [2].NewKeyDownEvent (Key.Enter));
         Application.Top.Draw ();
@@ -3180,7 +3180,7 @@ Edit
 ";
 
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (1, 0, 10, 6), pos);
+        Assert.Equal (new Rectangle (1, 0, 10, 6), pos);
 
         Assert.True (Application.Top.Subviews [1].NewKeyDownEvent (Key.Esc));
         Application.Top.Draw ();
@@ -3190,7 +3190,7 @@ Edit
 ";
 
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (1, 0, 8, 1), pos);
+        Assert.Equal (new Rectangle (1, 0, 8, 1), pos);
     }
 
     [Fact]
@@ -3242,8 +3242,8 @@ Edit
  Numbers
 ";
 
-        Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (1, 0, 8, 1), pos);
+        Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
+        Assert.Equal (new Rectangle (1, 0, 8, 1), pos);
 
         Assert.True (
                      menu.MouseEvent (
@@ -3262,7 +3262,7 @@ Edit
 ";
 
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (1, 0, 10, 6), pos);
+        Assert.Equal (new Rectangle (1, 0, 10, 6), pos);
 
         Assert.False (
                       menu.MouseEvent (
@@ -3282,7 +3282,7 @@ Edit
 ";
 
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (1, 0, 15, 7), pos);
+        Assert.Equal (new Rectangle (1, 0, 15, 7), pos);
 
         Assert.False (
                       menu.MouseEvent (
@@ -3301,7 +3301,7 @@ Edit
 ";
 
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (1, 0, 10, 6), pos);
+        Assert.Equal (new Rectangle (1, 0, 10, 6), pos);
 
         Assert.False (
                       menu.MouseEvent (
@@ -3315,7 +3315,7 @@ Edit
 ";
 
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (1, 0, 8, 1), pos);
+        Assert.Equal (new Rectangle (1, 0, 8, 1), pos);
     }
 
     [Fact]
@@ -3436,8 +3436,8 @@ Edit
  Numbers
 ";
 
-        Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (1, 0, 8, 1), pos);
+        Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
+        Assert.Equal (new Rectangle (1, 0, 8, 1), pos);
 
         Assert.True (
                      menu.MouseEvent (
@@ -3454,7 +3454,7 @@ Edit
 ";
 
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (1, 0, 8, 4), pos);
+        Assert.Equal (new Rectangle (1, 0, 8, 4), pos);
 
         Assert.False (
                       menu.MouseEvent (
@@ -3472,7 +3472,7 @@ Edit
 ";
 
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (1, 0, 13, 5), pos);
+        Assert.Equal (new Rectangle (1, 0, 13, 5), pos);
 
         Assert.False (
                       menu.MouseEvent (
@@ -3489,7 +3489,7 @@ Edit
 ";
 
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (1, 0, 8, 4), pos);
+        Assert.Equal (new Rectangle (1, 0, 8, 4), pos);
 
         Assert.False (
                       menu.MouseEvent (
@@ -3503,7 +3503,7 @@ Edit
 ";
 
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (1, 0, 8, 1), pos);
+        Assert.Equal (new Rectangle (1, 0, 8, 1), pos);
     }
 
     [Fact]

+ 8 - 8
UnitTests/Views/RadioGroupTests.cs

@@ -14,13 +14,13 @@ public class RadioGroupTests
         var rg = new RadioGroup ();
         Assert.True (rg.CanFocus);
         Assert.Empty (rg.RadioLabels);
-        Assert.Equal (Rect.Empty, rg.Frame);
+        Assert.Equal (Rectangle.Empty, rg.Frame);
         Assert.Equal (0, rg.SelectedItem);
 
         rg = new RadioGroup { RadioLabels = new [] { "Test" } };
         Assert.True (rg.CanFocus);
         Assert.Single (rg.RadioLabels);
-        Assert.Equal (new Rect (0, 0, 0, 0), rg.Frame);
+        Assert.Equal (new Rectangle (0, 0, 0, 0), rg.Frame);
         Assert.Equal (0, rg.SelectedItem);
 
         rg = new RadioGroup
@@ -33,7 +33,7 @@ public class RadioGroupTests
         };
         Assert.True (rg.CanFocus);
         Assert.Single (rg.RadioLabels);
-        Assert.Equal (new Rect (1, 2, 20, 5), rg.Frame);
+        Assert.Equal (new Rectangle (1, 2, 20, 5), rg.Frame);
         Assert.Equal (0, rg.SelectedItem);
 
         rg = new RadioGroup { X = 1, Y = 2, RadioLabels = new [] { "Test" } };
@@ -46,7 +46,7 @@ public class RadioGroupTests
 
         Assert.True (rg.CanFocus);
         Assert.Single (rg.RadioLabels);
-        Assert.Equal (new Rect (1, 2, 6, 1), rg.Frame);
+        Assert.Equal (new Rectangle (1, 2, 6, 1), rg.Frame);
         Assert.Equal (0, rg.SelectedItem);
     }
 
@@ -195,8 +195,8 @@ public class RadioGroupTests
 └────────────────────────────┘
 ";
 
-        Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (0, 0, 30, 5), pos);
+        Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
+        Assert.Equal (new Rectangle (0, 0, 30, 5), pos);
 
         rg.Orientation = Orientation.Horizontal;
         Application.Refresh ();
@@ -221,7 +221,7 @@ public class RadioGroupTests
 ";
 
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (0, 0, 30, 5), pos);
+        Assert.Equal (new Rectangle (0, 0, 30, 5), pos);
 
         rg.HorizontalSpace = 4;
         Application.Refresh ();
@@ -246,7 +246,7 @@ public class RadioGroupTests
 ";
 
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (0, 0, 30, 5), pos);
+        Assert.Equal (new Rectangle (0, 0, 30, 5), pos);
     }
 
     [Fact]

+ 15 - 15
UnitTests/Views/ScrollBarViewTests.cs

@@ -26,7 +26,7 @@ public class ScrollBarViewTests
         Assert.Equal (1, _scrollBar.Bounds.Width);
 
         Assert.Equal (
-                      "Combine(View(Height,HostView()(0,0,80,25))-Absolute(1))",
+                      $"Combine(View(Height,HostView(){_hostView.Frame})-Absolute(1))",
                       _scrollBar.Height.ToString ()
                      );
         Assert.Equal (24, _scrollBar.Bounds.Height);
@@ -34,7 +34,7 @@ public class ScrollBarViewTests
         Assert.True (_scrollBar.OtherScrollBarView.Visible);
 
         Assert.Equal (
-                      "Combine(View(Width,HostView()(0,0,80,25))-Absolute(1))",
+                      $"Combine(View(Width,HostView(){_hostView.Frame})-Absolute(1))",
                       _scrollBar.OtherScrollBarView.Width.ToString ()
                      );
         Assert.Equal (79, _scrollBar.OtherScrollBarView.Bounds.Width);
@@ -49,7 +49,7 @@ public class ScrollBarViewTests
         Assert.Equal (1, _scrollBar.Bounds.Width);
 
         Assert.Equal (
-                      "Combine(View(Height,HostView()(0,0,80,25))-Absolute(1))",
+                      $"Combine(View(Height,HostView(){_hostView.Frame})-Absolute(1))",
                       _scrollBar.Height.ToString ()
                      );
         Assert.Equal (24, _scrollBar.Bounds.Height);
@@ -57,7 +57,7 @@ public class ScrollBarViewTests
         Assert.True (_scrollBar.OtherScrollBarView.Visible);
 
         Assert.Equal (
-                      "View(Width,HostView()(0,0,80,25))",
+                      $"View(Width,HostView(){_hostView.Frame})",
                       _scrollBar.OtherScrollBarView.Width.ToString ()
                      );
         Assert.Equal (80, _scrollBar.OtherScrollBarView.Bounds.Width);
@@ -72,7 +72,7 @@ public class ScrollBarViewTests
         Assert.Equal (1, _scrollBar.Bounds.Width);
 
         Assert.Equal (
-                      "Combine(View(Height,HostView()(0,0,80,25))-Absolute(1))",
+                      $"Combine(View(Height,HostView(){_hostView.Frame})-Absolute(1))",
                       _scrollBar.Height.ToString ()
                      );
         Assert.Equal (24, _scrollBar.Bounds.Height);
@@ -80,7 +80,7 @@ public class ScrollBarViewTests
         Assert.False (_scrollBar.OtherScrollBarView.Visible);
 
         Assert.Equal (
-                      "View(Width,HostView()(0,0,80,25))",
+                      $"View(Width,HostView(){_hostView.Frame})",
                       _scrollBar.OtherScrollBarView.Width.ToString ()
                      );
         Assert.Equal (80, _scrollBar.OtherScrollBarView.Bounds.Width);
@@ -95,7 +95,7 @@ public class ScrollBarViewTests
         Assert.Equal (1, _scrollBar.Bounds.Width);
 
         Assert.Equal (
-                      "View(Height,HostView()(0,0,80,25))",
+                      $"View(Height,HostView(){_hostView.Frame})",
                       _scrollBar.Height.ToString ()
                      );
         Assert.Equal (25, _scrollBar.Bounds.Height);
@@ -103,7 +103,7 @@ public class ScrollBarViewTests
         Assert.False (_scrollBar.OtherScrollBarView.Visible);
 
         Assert.Equal (
-                      "View(Width,HostView()(0,0,80,25))",
+                      $"View(Width,HostView(){_hostView.Frame})",
                       _scrollBar.OtherScrollBarView.Width.ToString ()
                      );
         Assert.Equal (80, _scrollBar.OtherScrollBarView.Bounds.Width);
@@ -118,7 +118,7 @@ public class ScrollBarViewTests
         Assert.Equal (1, _scrollBar.Bounds.Width);
 
         Assert.Equal (
-                      "Combine(View(Height,HostView()(0,0,80,25))-Absolute(1))",
+                      $"Combine(View(Height,HostView(){_hostView.Frame})-Absolute(1))",
                       _scrollBar.Height.ToString ()
                      );
         Assert.Equal (24, _scrollBar.Bounds.Height);
@@ -126,7 +126,7 @@ public class ScrollBarViewTests
         Assert.True (_scrollBar.OtherScrollBarView.Visible);
 
         Assert.Equal (
-                      "Combine(View(Width,HostView()(0,0,80,25))-Absolute(1))",
+                      $"Combine(View(Width,HostView(){_hostView.Frame})-Absolute(1))",
                       _scrollBar.OtherScrollBarView.Width.ToString ()
                      );
         Assert.Equal (79, _scrollBar.OtherScrollBarView.Bounds.Width);
@@ -857,8 +857,8 @@ This is a test
 └───────────────────────────────────────────┘
 ";
 
-        Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (0, 0, 45, 20), pos);
+        Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
+        Assert.Equal (new Rectangle (0, 0, 45, 20), pos);
 
         textView.WordWrap = true;
         ((FakeDriver)Application.Driver).SetBufferSize (26, 20);
@@ -896,7 +896,7 @@ This is a test
 ";
 
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (0, 0, 26, 20), pos);
+        Assert.Equal (new Rectangle (0, 0, 26, 20), pos);
 
         ((FakeDriver)Application.Driver).SetBufferSize (10, 10);
         Application.Refresh ();
@@ -924,7 +924,7 @@ This is a test
 ";
 
         pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
-        Assert.Equal (new Rect (0, 0, 10, 10), pos);
+        Assert.Equal (new Rectangle (0, 0, 10, 10), pos);
     }
 
     [Fact]
@@ -960,7 +960,7 @@ This is a test
     public void Internal_Tests ()
     {
         Toplevel top = Application.Top;
-        Assert.Equal (new Rect (0, 0, 80, 25), top.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 80, 25), top.Bounds);
         var view = new View { Width = Dim.Fill (), Height = Dim.Fill () };
         top.Add (view);
         var sbv = new ScrollBarView (view, true);

部分文件因为文件数量过多而无法显示