diff --git a/Terminal.Gui/View/Adornment/Border.cs b/Terminal.Gui/View/Adornment/Border.cs index 6253948f7..6f8e701de 100644 --- a/Terminal.Gui/View/Adornment/Border.cs +++ b/Terminal.Gui/View/Adornment/Border.cs @@ -98,100 +98,6 @@ public class Border : Adornment } set => _lineStyle = value; } - - /// Draws a frame in the current view, clipped by the boundary of this view - /// View-relative region for the frame to be drawn. - /// If set to it clear the region. - [Obsolete ("This method is obsolete in v2. Use use LineCanvas or Frame instead.", false)] - public void DrawFrame (Rectangle region, bool clear) - { - Rectangle savedClip = ClipToBounds (); - Rectangle screenBounds = BoundsToScreen (region); - - if (clear) - { - Driver.FillRect (region); - } - - var lc = new LineCanvas (); - bool drawTop = region.Width > 1 && region.Height > 1; - bool drawLeft = region.Width > 1 && region.Height > 1; - bool drawBottom = region.Width > 1 && region.Height > 1; - bool drawRight = region.Width > 1 && region.Height > 1; - - if (drawTop) - { - lc.AddLine (screenBounds.Location, screenBounds.Width, Orientation.Horizontal, LineStyle); - } - - if (drawLeft) - { - lc.AddLine (screenBounds.Location, screenBounds.Height, Orientation.Vertical, LineStyle); - } - - if (drawBottom) - { - lc.AddLine ( - new Point (screenBounds.X, screenBounds.Y + screenBounds.Height - 1), - screenBounds.Width, - Orientation.Horizontal, - LineStyle - ); - } - - if (drawRight) - { - lc.AddLine ( - new Point (screenBounds.X + screenBounds.Width - 1, screenBounds.Y), - screenBounds.Height, - Orientation.Vertical, - LineStyle - ); - } - - foreach (KeyValuePair p in lc.GetMap ()) - { - Driver.Move (p.Key.X, p.Key.Y); - Driver.AddRune (p.Value); - } - - lc.Clear (); - - // TODO: This should be moved to LineCanvas as a new BorderStyle.Ruler - if ((ConsoleDriver.Diagnostics & ConsoleDriver.DiagnosticFlags.FrameRuler) - == ConsoleDriver.DiagnosticFlags.FrameRuler) - { - // Top - var hruler = new Ruler { Length = screenBounds.Width, Orientation = Orientation.Horizontal }; - - if (drawTop) - { - hruler.Draw (new Point (screenBounds.X, screenBounds.Y)); - } - - //Left - var vruler = new Ruler { Length = screenBounds.Height - 2, Orientation = Orientation.Vertical }; - - if (drawLeft) - { - vruler.Draw (new Point (screenBounds.X, screenBounds.Y + 1), 1); - } - - // Bottom - if (drawBottom) - { - hruler.Draw (new Point (screenBounds.X, screenBounds.Y + screenBounds.Height - 1)); - } - - // Right - if (drawRight) - { - vruler.Draw (new Point (screenBounds.X + screenBounds.Width - 1, screenBounds.Y + 1), 1); - } - } - - Driver.Clip = savedClip; - } /// public override void OnDrawContent (Rectangle contentArea)