Przeglądaj źródła

Merge branch 'tree-view' of https://github.com/tznind/gui.cs into tree-view

tznind 4 lat temu
rodzic
commit
cd63ac0f20
1 zmienionych plików z 6 dodań i 6 usunięć
  1. 6 6
      Terminal.Gui/Views/TreeView.cs

+ 6 - 6
Terminal.Gui/Views/TreeView.cs

@@ -1079,17 +1079,17 @@ namespace Terminal.Gui {
 		{
 			var map = BuildLineMap();
 
-			if(SelectedObject != null)
-				yield return SelectedObject;
-
 			// To determine multi selected objects, start with the line map, that avoids yielding hidden nodes that were selected then the parent collapsed e.g. programmatically or with mouse click
 			if(MultiSelect){
 				foreach(var m in map.Select(b=>b.Model).Where(IsSelected)){
-					if(m != SelectedObject){
-						yield return m;
-					}
+					yield return m;
 				}	
 			}
+			else
+			{
+				if(SelectedObject != null)
+					yield return SelectedObject;
+			}
 		}
 
 		/// <summary>