/// <summary> /// Write to buffer /// </summary> /// <param name="buffer">Buffer</param> /// <param name="rectangle">Rectangle</param> public override void WriteToBuffer(BufferCell[,] buffer, RectInt rectangle) { ConsoleUIUtils.WriteBorder(ForegroundColor, BackgroundColor, BorderStyle, IsTopOpen, IsBottomOpen, IsLeftOpen, IsRightOpen, AllowTransparency, buffer, new RectInt(rectangle.Position, Vector2Int.Min(Size, rectangle.Size))); foreach (IConsoleUIControl control in Controls) { if (control.IsVisible) { RectInt intersection = RectInt.GetIntersection(new RectInt(rectangle.Position + control.Position + Vector2Int.one, control.Size), new RectInt(rectangle.Position + Vector2Int.one, rectangle.Size - Vector2Int.two)); control.WriteToBuffer(buffer, intersection); } } }