Преглед изворни кода

Re-apply Rect->Rectangle name changes in these files

Brandon Thetford пре 1 година
родитељ
комит
17d028432e

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

@@ -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 ());
                 }

+ 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) =>

+ 4 - 4
UnitTests/View/Text/AutoSizeTrueTests.cs

@@ -2141,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 = @"
 ┌────────────────────┐
@@ -2169,7 +2169,7 @@ Y
 └────────────────────┘
 ";
 
-        Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
+        Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
 
         verticalView.Text = "最初_の行二行目";
         Application.Top.Draw ();
@@ -2177,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 = @"
 ┌────────────────────┐

+ 5 - 5
UnitTests/Views/ButtonTests.cs

@@ -127,11 +127,11 @@ public class ButtonTests
         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 =
             $"{

+ 6 - 6
UnitTests/Views/LabelTests.cs

@@ -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 (

+ 1 - 1
UnitTests/Views/TextViewTests.cs

@@ -8894,7 +8894,7 @@ Line 2.",
         TestHelpers.AssertDriverContentsWithFrameAre ("Line 2.", _output);
 
         Assert.True (_textView.NewKeyDownEvent (Key.H.WithShift));
-        Assert.NotEqual (Rect.Empty, _textView._needsDisplayRect);
+        Assert.NotEqual (Rectangle.Empty, _textView._needsDisplayRect);
         Application.Refresh ();
 
         TestHelpers.AssertDriverContentsWithFrameAre (