diff --git a/CLITest/Program.cs b/CLITest/Program.cs index 90f2728..798a0fd 100644 --- a/CLITest/Program.cs +++ b/CLITest/Program.cs @@ -79,6 +79,11 @@ namespace CLITest } Console.ResetColor(); Console.Clear(); + Console.WriteLine("Test2"); + Thread.Sleep(100); + DiffDraw.Clear(10, 10); + DiffDraw.Draw(true, false); + Console.Clear(); Console.WriteLine("Bye"); } } diff --git a/Commandline/TUI/DiffDraw.cs b/Commandline/TUI/DiffDraw.cs index 6ee50d7..78c1197 100644 --- a/Commandline/TUI/DiffDraw.cs +++ b/Commandline/TUI/DiffDraw.cs @@ -40,13 +40,13 @@ namespace CC_Functions.Commandline.TUI { for (int x = 0; x < width; x++) { - Pixel? tmp1 = Screen[y, x]; - if (full && tmp1 == _last[y, x]) continue; - if (tmp1 != null && color) + Pixel tmp1 = Screen[y, x]; + if (!full && tmp1 == _last[y, x]) continue; + if (ReferenceEquals(tmp1, null) && color) { - if (Console.ForegroundColor != tmp1.ForeColor) + if (Console.ForegroundColor != tmp1?.ForeColor && tmp1?.ForeColor != null) Console.ForegroundColor = tmp1.ForeColor; - if (Console.BackgroundColor != tmp1.BackColor) + if (Console.BackgroundColor != tmp1?.BackColor && tmp1?.ForeColor != null) Console.BackgroundColor = tmp1.BackColor; } Console.CursorLeft = x;