Skip to content

Commit b7be220

Browse files
committed
Fixing the refresh bug on swapping of the ConsoleManager.Content
1 parent 29e0631 commit b7be220

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

ConsoleGUI/Buffering/ConsoleBuffer.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ public void Initialize(in Size size)
1717
_buffer = new Cell?[size.Width, size.Height];
1818
}
1919

20+
public void Clear()
21+
{
22+
for (int i = 0; i < _buffer.GetLength(0); i++)
23+
for (int j = 0; j < _buffer.GetLength(1); j++)
24+
_buffer[i, j] = null;
25+
}
26+
2027
public bool Update(in Position position, in Cell newCell)
2128
{
2229
ref var cell = ref _buffer[position.X, position.Y];

ConsoleGUI/ConsoleGUI.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
<PackageTags>console, gui, framework</PackageTags>
1515
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
1616
<Version>1.4.0</Version>
17-
<PackageReleaseNotes>1.4.0 - Customizable data grid style
17+
<PackageReleaseNotes>1.4.1 - Fixing the refresh bug on swapping of the ConsoleManager.Content
18+
1.4.0 - Customizable data grid style
1819
1.3.0 - Making the ScrollUpKey and the ScrollDownKey configurable in the VerticalScrollPanel
1920
1.2.2 - Fixing AdjustWindowSize exception when window has 0 height
2021
1.2.1 - Fixing exceptions on window resizing

ConsoleGUI/ConsoleManager.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ private static void Initialize()
113113
var consoleSize = BufferSize;
114114

115115
Console.Initialize();
116+
_buffer.Clear();
116117

117118
_freezeLock.Freeze();
118119
ContentContext.SetLimits(consoleSize, consoleSize);

0 commit comments

Comments
 (0)