浏览代码

Prevents negative values if the windows size change so quickly.

BDisp 4 年之前
父节点
当前提交
a4b19b05b8
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      Terminal.Gui/ConsoleDrivers/NetDriver.cs

+ 3 - 1
Terminal.Gui/ConsoleDrivers/NetDriver.cs

@@ -177,7 +177,9 @@ namespace Terminal.Gui {
 			while (true) {
 				if (!consoleDriver.HeightAsBuffer) {
 					if (Console.WindowWidth != consoleDriver.Cols || Console.WindowHeight != consoleDriver.Rows) {
-						GetWindowSizeEvent (new Size (Console.WindowWidth, Console.WindowHeight));
+						var w = Math.Max (Console.WindowWidth, 0);
+						var h = Math.Max (Console.WindowHeight, 0);
+						GetWindowSizeEvent (new Size (w, h));
 						return;
 					}
 				} else {