瀏覽代碼

Reamed Bounds -> Viewport - MOAR rename

Tig 1 年之前
父節點
當前提交
b187a8e70f
共有 38 個文件被更改,包括 116 次插入116 次删除
  1. 1 1
      Terminal.Gui/Application.cs
  2. 2 2
      Terminal.Gui/ConsoleDrivers/ConsoleDriver.cs
  3. 7 7
      Terminal.Gui/Drawing/LineCanvas.cs
  4. 1 1
      Terminal.Gui/Text/Autocomplete/PopupAutocomplete.PopUp.cs
  5. 7 7
      Terminal.Gui/Text/TextFormatter.cs
  6. 5 5
      Terminal.Gui/View/Adornment/Adornment.cs
  7. 10 10
      Terminal.Gui/View/Adornment/Border.cs
  8. 2 2
      Terminal.Gui/View/Layout/ViewLayout.cs
  9. 3 3
      Terminal.Gui/View/ViewDrawing.cs
  10. 2 2
      Terminal.Gui/Views/ColorPicker.cs
  11. 3 3
      Terminal.Gui/Views/ComboBox.cs
  12. 2 2
      Terminal.Gui/Views/FileDialog.cs
  13. 1 1
      Terminal.Gui/Views/GraphView/GraphView.cs
  14. 1 1
      Terminal.Gui/Views/HexView.cs
  15. 2 2
      Terminal.Gui/Views/Line.cs
  16. 2 2
      Terminal.Gui/Views/LineView.cs
  17. 2 2
      Terminal.Gui/Views/ListView.cs
  18. 1 1
      Terminal.Gui/Views/Menu/Menu.cs
  19. 1 1
      Terminal.Gui/Views/Menu/MenuBar.cs
  20. 1 1
      Terminal.Gui/Views/ProgressBar.cs
  21. 2 2
      Terminal.Gui/Views/RadioGroup.cs
  22. 1 1
      Terminal.Gui/Views/ScrollBarView.cs
  23. 2 2
      Terminal.Gui/Views/ScrollView.cs
  24. 3 3
      Terminal.Gui/Views/Slider.cs
  25. 1 1
      Terminal.Gui/Views/StatusBar.cs
  26. 6 6
      Terminal.Gui/Views/TabView.cs
  27. 2 2
      Terminal.Gui/Views/TableView/TableView.cs
  28. 1 1
      Terminal.Gui/Views/TextField.cs
  29. 1 1
      Terminal.Gui/Views/TextValidateField.cs
  30. 3 3
      Terminal.Gui/Views/TextView.cs
  31. 21 21
      Terminal.Gui/Views/TileView.cs
  32. 2 2
      Terminal.Gui/Views/Toplevel.cs
  33. 1 1
      Terminal.Gui/Views/TreeView/TreeView.cs
  34. 2 2
      UICatalog/Scenarios/Animation.cs
  35. 6 6
      UICatalog/Scenarios/CharacterMap.cs
  36. 2 2
      UICatalog/Scenarios/LineDrawing.cs
  37. 3 3
      UICatalog/Scenarios/Snake.cs
  38. 1 1
      UnitTests/View/ViewTests.cs

+ 1 - 1
Terminal.Gui/Application.cs

@@ -1365,7 +1365,7 @@ public static partial class Application
     /// <remarks>
     ///     <para>
     ///         Use this event to receive mouse events in screen coordinates. Use <see cref="MouseEvent"/> to
-    ///         receive mouse events relative to a <see cref="View"/>'s bounds.
+    ///         receive mouse events relative to a <see cref="View.Viewport"/>.
     ///     </para>
     ///     <para>The <see cref="MouseEvent.View"/> will contain the <see cref="View"/> that contains the mouse coordinates.</para>
     /// </remarks>

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

@@ -25,7 +25,7 @@ public abstract class ConsoleDriver
     ///     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>
+    /// <value>The rectangle describing the of <see cref="Clip"/> region.</value>
     public Rectangle Clip { get; set; }
 
     /// <summary>Get the operating system clipboard.</summary>
@@ -372,7 +372,7 @@ public abstract class ConsoleDriver
     /// <param name="col">The column.</param>
     /// <param name="row">The row.</param>
     /// <returns>
-    ///     <see langword="false"/> if the coordinate is outside of the screen bounds or outside of <see cref="Clip"/>.
+    ///     <see langword="false"/> if the coordinate is outside the screen bounds or outside of <see cref="Clip"/>.
     ///     <see langword="true"/> otherwise.
     /// </returns>
     public bool IsValidLocation (int col, int row) { return col >= 0 && row >= 0 && col < Cols && row < Rows && Clip.Contains (col, row); }

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

@@ -78,23 +78,23 @@ public class LineCanvas : IDisposable
                     return _cachedViewport;
                 }
 
-                Rectangle bounds = _lines [0].Viewport;
+                Rectangle viewport = _lines [0].Viewport;
 
                 for (var i = 1; i < _lines.Count; i++)
                 {
-                    bounds = Rectangle.Union (bounds, _lines [i].Viewport);
+                    viewport = Rectangle.Union (viewport, _lines [i].Viewport);
                 }
 
-                if (bounds is {Width: 0} or {Height: 0})
+                if (viewport is {Width: 0} or {Height: 0})
                 {
-                    bounds = bounds with
+                    viewport = viewport with
                     {
-                        Width = Math.Clamp (bounds.Width, 1, short.MaxValue),
-                        Height = Math.Clamp (bounds.Height, 1, short.MaxValue)
+                        Width = Math.Clamp (viewport.Width, 1, short.MaxValue),
+                        Height = Math.Clamp (viewport.Height, 1, short.MaxValue)
                     };
                 }
 
-                _cachedViewport = bounds;
+                _cachedViewport = viewport;
             }
 
             return _cachedViewport;

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

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

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

@@ -240,12 +240,12 @@ public class TextFormatter
         }
 
         bool isVertical = IsVerticalDirection (Direction);
-        Rectangle maxBounds = viewport;
+        Rectangle maxViewport = viewport;
 
         if (driver is { })
         {
             // INTENT: What, exactly, is the intent of this?
-            maxBounds = maximum == default (Rectangle)
+            maxViewport = maximum == default (Rectangle)
                             ? viewport
                             : new (
                                    Math.Max (maximum.X, viewport.X),
@@ -264,7 +264,7 @@ public class TextFormatter
                                   );
         }
 
-        if (maxBounds.Width == 0 || maxBounds.Height == 0)
+        if (maxViewport.Width == 0 || maxViewport.Height == 0)
         {
             return;
         }
@@ -278,8 +278,8 @@ public class TextFormatter
                 continue;
             }
 
-            if ((isVertical && line >= maxBounds.Left + maxBounds.Width)
-                || (!isVertical && line >= maxBounds.Top + maxBounds.Height + lineOffset))
+            if ((isVertical && line >= maxViewport.Left + maxViewport.Width)
+                || (!isVertical && line >= maxViewport.Top + maxViewport.Height + lineOffset))
             {
                 break;
             }
@@ -422,8 +422,8 @@ public class TextFormatter
                         break;
                     }
 
-                    if ((!isVertical && current - start > maxBounds.Left + maxBounds.Width - viewport.X + colOffset)
-                        || (isVertical && idx > maxBounds.Top + maxBounds.Height - viewport.Y))
+                    if ((!isVertical && current - start > maxViewport.Left + maxViewport.Width - viewport.X + colOffset)
+                        || (isVertical && idx > maxViewport.Top + maxViewport.Height - viewport.Y))
                     {
                         break;
                     }

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

@@ -139,19 +139,19 @@ 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 (Rectangle contentArea)
+    public override void OnDrawContent (Rectangle viewport)
     {
         if (Thickness == Thickness.Empty)
         {
             return;
         }
 
-        Rectangle screenBounds = ViewportToScreen (contentArea);
+        Rectangle screen = ViewportToScreen (viewport);
         Attribute normalAttr = GetNormalColor ();
         Driver.SetAttribute (normalAttr);
 
         // This just draws/clears the thickness, not the insides.
-        Thickness.Draw (screenBounds, ToString ());
+        Thickness.Draw (screen, ToString ());
 
         if (!string.IsNullOrEmpty (TextFormatter.Text))
         {
@@ -162,11 +162,11 @@ public class Adornment : View
             }
         }
 
-        TextFormatter?.Draw (screenBounds, normalAttr, normalAttr, Rectangle.Empty);
+        TextFormatter?.Draw (screen, normalAttr, normalAttr, Rectangle.Empty);
 
         if (Subviews.Count > 0)
         {
-            base.OnDrawContent (contentArea);
+            base.OnDrawContent (viewport);
         }
 
         ClearLayoutNeeded ();

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

@@ -136,14 +136,14 @@ public class Border : Adornment
         }
     }
 
-    Rectangle GetBorderBounds (Rectangle screenBounds)
+    Rectangle GetBorderRectangle (Rectangle screenRect)
     {
         return new (
-                                      screenBounds.X + Math.Max (0, Thickness.Left - 1),
-                                      screenBounds.Y + Math.Max (0, Thickness.Top - 1),
+                                      screenRect.X + Math.Max (0, Thickness.Left - 1),
+                                      screenRect.Y + Math.Max (0, Thickness.Top - 1),
                                       Math.Max (
                                                 0,
-                                                screenBounds.Width
+                                                screenRect.Width
                                                 - Math.Max (
                                                             0,
                                                             Math.Max (0, Thickness.Left - 1)
@@ -152,7 +152,7 @@ public class Border : Adornment
                                                ),
                                       Math.Max (
                                                 0,
-                                                screenBounds.Height
+                                                screenRect.Height
                                                 - Math.Max (
                                                             0,
                                                             Math.Max (0, Thickness.Top - 1)
@@ -184,9 +184,9 @@ public class Border : Adornment
     }
 
     /// <inheritdoc/>
-    public override void OnDrawContent (Rectangle contentArea)
+    public override void OnDrawContent (Rectangle viewport)
     {
-        base.OnDrawContent (contentArea);
+        base.OnDrawContent (viewport);
 
         if (Thickness == Thickness.Empty)
         {
@@ -194,7 +194,7 @@ public class Border : Adornment
         }
 
         //Driver.SetAttribute (Colors.ColorSchemes ["Error"].Normal);
-        Rectangle screenBounds = ViewportToScreen (contentArea);
+        Rectangle screenBounds = ViewportToScreen (viewport);
 
         //OnDrawSubviews (bounds); 
 
@@ -205,7 +205,7 @@ public class Border : Adornment
         // ...thickness extends outward (border/title is always as far in as possible)
         // PERF: How about a call to Rectangle.Offset?
 
-        var borderBounds = GetBorderBounds (screenBounds);
+        var borderBounds = GetBorderRectangle (screenBounds);
         int topTitleLineY = borderBounds.Y;
         int titleY = borderBounds.Y;
         var titleBarsLength = 0; // the little vertical thingies
@@ -466,6 +466,6 @@ public class Border : Adornment
             }
         }
 
-        //base.OnDrawContent (contentArea);
+        //base.OnDrawContent (viewport);
     }
 }

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

@@ -1410,10 +1410,10 @@ public partial class View
         return result;
     } // TopologicalSort
 
-    private void LayoutSubview (View v, Rectangle contentArea)
+    private void LayoutSubview (View v, Rectangle viewport)
     {
         //if (v.LayoutStyle == LayoutStyle.Computed) {
-        v.SetRelativeLayout (contentArea);
+        v.SetRelativeLayout (viewport);
 
         //}
 

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

@@ -87,7 +87,7 @@ public partial class View
     /// <summary>Clears the specified <see cref="Viewport"/>-relative rectangle with the normal background.</summary>
     /// <remarks></remarks>
     /// <param name="contentArea">The Viewport-relative rectangle to clear.</param>
-    public void Clear (Rectangle contentArea)
+    public void Clear (Rectangle viewport)
     {
         if (Driver is null)
         {
@@ -97,8 +97,8 @@ public partial class View
         Attribute prev = Driver.SetAttribute (GetNormalColor ());
 
         // Clamp the region to the bounds of the view
-        contentArea = Rectangle.Intersect (contentArea, Viewport);
-        Driver.FillRect (ViewportToScreen (contentArea));
+        viewport = Rectangle.Intersect (viewport, Viewport);
+        Driver.FillRect (ViewportToScreen (viewport));
         Driver.SetAttribute (prev);
     }
 

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

@@ -157,9 +157,9 @@ public class ColorPicker : View
     }
 
     ///<inheritdoc/>
-    public override void OnDrawContent (Rectangle contentArea)
+    public override void OnDrawContent (Rectangle viewport)
     {
-        base.OnDrawContent (contentArea);
+        base.OnDrawContent (viewport);
 
         Driver.SetAttribute (HasFocus ? ColorScheme.Focus : GetNormalColor ());
         var colorIndex = 0;

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

@@ -284,9 +284,9 @@ public class ComboBox : View
     public virtual void OnCollapsed () { Collapsed?.Invoke (this, EventArgs.Empty); }
 
     /// <inheritdoc/>
-    public override void OnDrawContent (Rectangle contentArea)
+    public override void OnDrawContent (Rectangle viewport)
     {
-        base.OnDrawContent (contentArea);
+        base.OnDrawContent (viewport);
 
         if (!_autoHide)
         {
@@ -839,7 +839,7 @@ public class ComboBox : View
             return res;
         }
 
-        public override void OnDrawContent (Rectangle contentArea)
+        public override void OnDrawContent (Rectangle viewport)
         {
             Attribute current = ColorScheme.Focus;
             Driver.SetAttribute (current);

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

@@ -407,9 +407,9 @@ public class FileDialog : Dialog
     }
 
     /// <inheritdoc/>
-    public override void OnDrawContent (Rectangle contentArea)
+    public override void OnDrawContent (Rectangle viewport)
     {
-        base.OnDrawContent (contentArea);
+        base.OnDrawContent (viewport);
 
         if (!string.IsNullOrWhiteSpace (_feedback))
         {

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

@@ -197,7 +197,7 @@ public class GraphView : View
     }
 
     ///<inheritdoc/>
-    public override void OnDrawContent (Rectangle contentArea)
+    public override void OnDrawContent (Rectangle viewport)
     {
         if (CellSize.X == 0 || CellSize.Y == 0)
         {

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

@@ -351,7 +351,7 @@ public class HexView : View
     }
 
     ///<inheritdoc/>
-    public override void OnDrawContent (Rectangle contentArea)
+    public override void OnDrawContent (Rectangle viewport)
     {
         Attribute currentAttribute;
         Attribute current = ColorScheme.Focus;

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

@@ -17,7 +17,7 @@ public class Line : View
     public Orientation Orientation { get; set; }
 
     /// <inheritdoc/>
-    public override void OnDrawContent (Rectangle contentArea)
+    public override void OnDrawContent (Rectangle viewport)
     {
         LineCanvas lc = LineCanvas;
 
@@ -26,7 +26,7 @@ public class Line : View
             lc = adornment.Parent.LineCanvas;
         }
         lc.AddLine (
-                    ViewportToScreen (contentArea).Location,
+                    ViewportToScreen (viewport).Location,
                     Orientation == Orientation.Horizontal ? Frame.Width : Frame.Height,
                     Orientation,
                     BorderStyle

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

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

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

@@ -616,9 +616,9 @@ public class ListView : View
     }
 
     /// <inheritdoc/>
-    public override void OnDrawContent (Rectangle contentArea)
+    public override void OnDrawContent (Rectangle viewport)
     {
-        base.OnDrawContent (contentArea);
+        base.OnDrawContent (viewport);
 
         Attribute current = ColorScheme.Focus;
         Driver.SetAttribute (current);

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

@@ -755,7 +755,7 @@ internal sealed class Menu : View
         return !item.IsEnabled () ? ColorScheme.Disabled : GetNormalColor ();
     }
 
-    public override void OnDrawContent (Rectangle contentArea)
+    public override void OnDrawContent (Rectangle viewport)
     {
         if (_barItems.Children is null)
         {

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

@@ -469,7 +469,7 @@ public class MenuBar : View
     public event EventHandler<MenuOpeningEventArgs> MenuOpening;
 
     /// <inheritdoc/>
-    public override void OnDrawContent (Rectangle contentArea)
+    public override void OnDrawContent (Rectangle viewport)
     {
         Move (0, 0);
         Driver.SetAttribute (GetNormalColor ());

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

@@ -143,7 +143,7 @@ public class ProgressBar : View
     }
 
     ///<inheritdoc/>
-    public override void OnDrawContent (Rectangle contentArea)
+    public override void OnDrawContent (Rectangle viewport)
     {
         Driver.SetAttribute (GetHotNormalColor ());
 

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

@@ -201,9 +201,9 @@ public class RadioGroup : View
     }
 
     /// <inheritdoc/>
-    public override void OnDrawContent (Rectangle contentArea)
+    public override void OnDrawContent (Rectangle viewport)
     {
-        base.OnDrawContent (contentArea);
+        base.OnDrawContent (viewport);
 
         Driver.SetAttribute (GetNormalColor ());
 

+ 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 (Rectangle contentArea)
+    public override void OnDrawContent (Rectangle viewport)
     {
         if (ColorScheme is null || ((!_showScrollIndicator || Size == 0) && AutoHideScrollBars && Visible))
         {

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

@@ -335,14 +335,14 @@ public class ScrollView : View
     }
 
     /// <inheritdoc/>
-    public override void OnDrawContent (Rectangle contentArea)
+    public override void OnDrawContent (Rectangle viewport)
     {
         SetViewsNeedsDisplay ();
 
         Rectangle savedClip = ClipToViewport ();
 
         // TODO: It's bad practice for views to always clear a view. It negates clipping.
-        Clear (contentArea);
+        Clear (viewport);
 
         if (!string.IsNullOrEmpty (_contentView.Text) || _contentView.Subviews.Count > 0)
         {

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

@@ -996,7 +996,7 @@ public class Slider<T> : View
     }
 
     /// <inheritdoc/>
-    public override void OnDrawContent (Rectangle contentArea)
+    public override void OnDrawContent (Rectangle viewport)
     {
         // TODO: make this more surgical to reduce repaint
 
@@ -1009,9 +1009,9 @@ public class Slider<T> : View
 #if (DEBUG)
         Driver?.SetAttribute (new Attribute (Color.White, Color.Red));
 
-        for (var y = 0; y < contentArea.Height; y++)
+        for (var y = 0; y < viewport.Height; y++)
         {
-            for (var x = 0; x < contentArea.Width; x++)
+            for (var x = 0; x < viewport.Width; x++)
             {
                 // MoveAndAdd (x, y, '·');
             }

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

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

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

@@ -311,14 +311,14 @@ public class TabView : View
     public int EnsureValidScrollOffsets (int value) { return Math.Max (Math.Min (value, Tabs.Count - 1), 0); }
 
     /// <inheritdoc/>
-    public override void OnDrawContent (Rectangle contentArea)
+    public override void OnDrawContent (Rectangle viewport)
     {
         Driver.SetAttribute (GetNormalColor ());
 
         if (Tabs.Any ())
         {
             Rectangle savedClip = ClipToViewport ();
-            _tabsBar.OnDrawContent (contentArea);
+            _tabsBar.OnDrawContent (viewport);
             _contentView.SetNeedsDisplay ();
             _contentView.Draw ();
             Driver.Clip = savedClip;
@@ -326,7 +326,7 @@ public class TabView : View
     }
 
     /// <inheritdoc/>
-    public override void OnDrawContentComplete (Rectangle contentArea) { _tabsBar.OnDrawContentComplete (contentArea); }
+    public override void OnDrawContentComplete (Rectangle viewport) { _tabsBar.OnDrawContentComplete (viewport); }
 
     /// <summary>
     ///     Removes the given <paramref name="tab"/> from <see cref="Tabs"/>. Caller is responsible for disposing the
@@ -657,12 +657,12 @@ public class TabView : View
             return false;
         }
 
-        public override void OnDrawContent (Rectangle contentArea)
+        public override void OnDrawContent (Rectangle viewport)
         {
             _host._tabLocations = _host.CalculateViewport (Viewport).ToArray ();
 
             // clear any old text
-            Clear (contentArea);
+            Clear (viewport);
 
             RenderTabLine ();
 
@@ -670,7 +670,7 @@ public class TabView : View
             Driver.SetAttribute (GetNormalColor ());
         }
 
-        public override void OnDrawContentComplete (Rectangle contentArea)
+        public override void OnDrawContentComplete (Rectangle viewport)
         {
             if (_host._tabLocations is null)
             {

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

@@ -896,9 +896,9 @@ public class TableView : View
     }
 
     ///<inheritdoc/>
-    public override void OnDrawContent (Rectangle contentArea)
+    public override void OnDrawContent (Rectangle viewport)
     {
-        base.OnDrawContent (contentArea);
+        base.OnDrawContent (viewport);
 
         Move (0, 0);
 

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

@@ -973,7 +973,7 @@ public class TextField : View
     }
 
     /// <inheritdoc/>
-    public override void OnDrawContent (Rectangle contentArea)
+    public override void OnDrawContent (Rectangle viewport)
     {
         _isDrawing = true;
 

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

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

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

@@ -3586,7 +3586,7 @@ public class TextView : View
     }
 
     /// <inheritdoc/>
-    public override void OnDrawContent (Rectangle contentArea)
+    public override void OnDrawContent (Rectangle viewport)
     {
         _isDrawing = true;
 
@@ -3649,7 +3649,7 @@ public class TextView : View
                     AddRune (col, row, rune);
                 }
 
-                if (!TextModel.SetCol (ref col, contentArea.Right, cols))
+                if (!TextModel.SetCol (ref col, viewport.Right, cols))
                 {
                     break;
                 }
@@ -3672,7 +3672,7 @@ public class TextView : View
         if (row < bottom)
         {
             SetNormalColor ();
-            ClearRegion (contentArea.Left, row, right, bottom);
+            ClearRegion (viewport.Left, row, right, bottom);
         }
 
         PositionCursor ();

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

@@ -156,19 +156,19 @@ public class TileView : View
             return;
         }
 
-        Rectangle contentArea = Viewport;
+        Rectangle viewport = Viewport;
 
         if (HasBorder ())
         {
-            contentArea = new (
-                               contentArea.X + 1,
-                               contentArea.Y + 1,
-                               Math.Max (0, contentArea.Width - 2),
-                               Math.Max (0, contentArea.Height - 2)
-                              );
+            viewport = new (
+                            viewport.X + 1,
+                            viewport.Y + 1,
+                            Math.Max (0, viewport.Width - 2),
+                            Math.Max (0, viewport.Height - 2)
+                           );
         }
 
-        Setup (contentArea);
+        Setup (viewport);
         base.LayoutSubviews ();
     }
 
@@ -179,12 +179,12 @@ public class TileView : View
     public override bool OnDrawAdornments () { return false; }
 
     /// <inheritdoc/>
-    public override void OnDrawContent (Rectangle contentArea)
+    public override void OnDrawContent (Rectangle viewport)
     {
         Driver.SetAttribute (ColorScheme.Normal);
-        Clear (contentArea);
+        Clear (viewport);
 
-        base.OnDrawContent (contentArea);
+        base.OnDrawContent (viewport);
 
         var lc = new LineCanvas ();
 
@@ -758,9 +758,9 @@ public class TileView : View
         return false;
     }
 
-    private void Setup (Rectangle contentArea)
+    private void Setup (Rectangle viewport)
     {
-        if (contentArea.IsEmpty || contentArea.Height <= 0 || contentArea.Width <= 0)
+        if (viewport.IsEmpty || viewport.Height <= 0 || viewport.Width <= 0)
         {
             return;
         }
@@ -803,16 +803,16 @@ public class TileView : View
 
             if (Orientation == Orientation.Vertical)
             {
-                tile.ContentView.X = i == 0 ? contentArea.X : Pos.Right (visibleSplitterLines [i - 1]);
-                tile.ContentView.Y = contentArea.Y;
-                tile.ContentView.Height = contentArea.Height;
+                tile.ContentView.X = i == 0 ? viewport.X : Pos.Right (visibleSplitterLines [i - 1]);
+                tile.ContentView.Y = viewport.Y;
+                tile.ContentView.Height = viewport.Height;
                 tile.ContentView.Width = GetTileWidthOrHeight (i, Viewport.Width, visibleTiles, visibleSplitterLines);
             }
             else
             {
-                tile.ContentView.X = contentArea.X;
-                tile.ContentView.Y = i == 0 ? contentArea.Y : Pos.Bottom (visibleSplitterLines [i - 1]);
-                tile.ContentView.Width = contentArea.Width;
+                tile.ContentView.X = viewport.X;
+                tile.ContentView.Y = i == 0 ? viewport.Y : Pos.Bottom (visibleSplitterLines [i - 1]);
+                tile.ContentView.Width = viewport.Width;
                 tile.ContentView.Height = GetTileWidthOrHeight (i, Viewport.Height, visibleTiles, visibleSplitterLines);
             }
         }
@@ -969,9 +969,9 @@ public class TileView : View
             return false;
         }
 
-        public override void OnDrawContent (Rectangle contentArea)
+        public override void OnDrawContent (Rectangle viewport)
         {
-            base.OnDrawContent (contentArea);
+            base.OnDrawContent (viewport);
 
             DrawSplitterSymbol ();
         }

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

@@ -249,7 +249,7 @@ public partial class Toplevel : View
     }
 
     /// <inheritdoc/>
-    public override void OnDrawContent (Rectangle contentArea)
+    public override void OnDrawContent (Rectangle viewport)
     {
         if (!Visible)
         {
@@ -292,7 +292,7 @@ public partial class Toplevel : View
                 }
             }
 
-            base.OnDrawContent (contentArea);
+            base.OnDrawContent (viewport);
 
             // This is causing the menus drawn incorrectly if UseSubMenusSingleFrame is true
             //if (this.MenuBar is { } && this.MenuBar.IsMenuOpen && this.MenuBar.openMenu is { }) {

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

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

+ 2 - 2
UICatalog/Scenarios/Animation.cs

@@ -163,9 +163,9 @@ public class Animation : Scenario
         private Rectangle oldSize = Rectangle.Empty;
         public void NextFrame () { currentFrame = (currentFrame + 1) % frameCount; }
 
-        public override void OnDrawContent (Rectangle contentArea)
+        public override void OnDrawContent (Rectangle viewport)
         {
-            base.OnDrawContent (contentArea);
+            base.OnDrawContent (viewport);
 
             if (oldSize != Viewport)
             {

+ 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 (Rectangle contentArea)
+    public override void OnDrawContent (Rectangle viewport)
     {
         //if (ShowHorizontalScrollIndicator && ContentSize.Height < (int)(MaxCodePoint / 16 + 2)) {
         //	//ContentSize = new (CharMap.RowWidth, (int)(MaxCodePoint / 16 + 2));
@@ -545,18 +545,18 @@ internal class CharMap : ScrollView
         //	// Snap 1st column into view if it's been scrolled horizontally
         //	ContentOffset = new (0, ContentOffset.Y < -ContentSize.Height + Viewport.Height ? ContentOffset.Y - 1 : ContentOffset.Y);
         //}
-        base.OnDrawContent (contentArea);
+        base.OnDrawContent (viewport);
     }
 
     //public void CharMap_DrawContent (object s, DrawEventArgs a)
-    public override void OnDrawContentComplete (Rectangle contentArea)
+    public override void OnDrawContentComplete (Rectangle viewport)
     {
-        if (contentArea.Height == 0 || contentArea.Width == 0)
+        if (viewport.Height == 0 || viewport.Width == 0)
         {
             return;
         }
 
-        Rectangle viewport = new (
+        Rectangle viewportOffset = new (
                                   ContentOffset,
                                   new (
                                        Math.Max (Viewport.Width - (ShowVerticalScrollIndicator ? 1 : 0), 0),
@@ -606,7 +606,7 @@ internal class CharMap : ScrollView
             }
         }
 
-        int firstColumnX = viewport.X + RowLabelWidth;
+        int firstColumnX = viewportOffset.X + RowLabelWidth;
 
         for (var y = 1; y < Viewport.Height; y++)
         {

+ 2 - 2
UICatalog/Scenarios/LineDrawing.cs

@@ -36,9 +36,9 @@ public class LineDrawing : Scenario
         public DrawingArea () { AddLayer (); }
         public LineStyle LineStyle { get; set; }
 
-        public override void OnDrawContentComplete (Rectangle contentArea)
+        public override void OnDrawContentComplete (Rectangle viewport)
         {
-            base.OnDrawContentComplete (contentArea);
+            base.OnDrawContentComplete (viewport);
 
             foreach (LineCanvas canvas in _layers)
             {

+ 3 - 3
UICatalog/Scenarios/Snake.cs

@@ -309,12 +309,12 @@ public class Snake : Scenario
 
         public SnakeState State { get; }
 
-        public override void OnDrawContent (Rectangle contentArea)
+        public override void OnDrawContent (Rectangle viewport)
         {
-            base.OnDrawContent (contentArea);
+            base.OnDrawContent (viewport);
 
             Driver.SetAttribute (white);
-            Clear (contentArea);
+            Clear (viewport);
 
             var canvas = new LineCanvas ();
 

+ 1 - 1
UnitTests/View/ViewTests.cs

@@ -1119,7 +1119,7 @@ At 0,0
         public bool IsKeyUp { get; set; }
         public override string Text { get; set; }
 
-        public override void OnDrawContent (Rectangle contentArea)
+        public override void OnDrawContent (Rectangle viewport)
         {
             var idx = 0;