Browse Source

Avoids SetNeedsDisplay on views already removed.

BDisp 2 năm trước cách đây
mục cha
commit
6986ab255e
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      Terminal.Gui/Core/View.cs

+ 2 - 2
Terminal.Gui/Core/View.cs

@@ -987,13 +987,13 @@ namespace Terminal.Gui {
 			if (view == null || subviews == null)
 			if (view == null || subviews == null)
 				return;
 				return;
 
 
-			SetNeedsLayout ();
-			SetNeedsDisplay ();
 			var touched = view.Frame;
 			var touched = view.Frame;
 			subviews.Remove (view);
 			subviews.Remove (view);
 			tabIndexes.Remove (view);
 			tabIndexes.Remove (view);
 			view.container = null;
 			view.container = null;
 			view.tabIndex = -1;
 			view.tabIndex = -1;
+			SetNeedsLayout ();
+			SetNeedsDisplay ();
 			if (subviews.Count < 1) {
 			if (subviews.Count < 1) {
 				CanFocus = false;
 				CanFocus = false;
 			}
 			}