2
0
flabbet 9 сар өмнө
parent
commit
78bccd3f29

+ 1 - 1
src/Drawie

@@ -1 +1 @@
-Subproject commit f0e42219c9eff585e788c2c427de404e887ddf89
+Subproject commit 84f1a4801d78fac0b0141711069dabe3fb0a1df7

+ 10 - 6
src/PixiEditor/ViewModels/SubViewModels/DiscordViewModel.cs

@@ -3,6 +3,7 @@ using DiscordRPC;
 using PixiEditor.Helpers;
 using PixiEditor.Extensions.CommonApi.UserPreferences.Settings.PixiEditor;
 using PixiEditor.Models.Controllers;
+using PixiEditor.Models.Handlers;
 using PixiEditor.ViewModels.Document;
 
 namespace PixiEditor.ViewModels.SubViewModels;
@@ -99,14 +100,17 @@ internal class DiscordViewModel : SubViewModel<ViewModelMain>, IDisposable
 
     private int CountLayers(NodeGraphViewModel graph)
     {
-        int counter = 0; //TODO: Implement this
-        /*foreach (var child in folder.Children)
+        int counter = 0; 
+        graph.TryTraverse(n =>
         {
-            if (child is LayerViewModel)
+            if(n is ILayerHandler layer)
+            {
                 counter++;
-            else if (child is FolderViewModel innerFolder)
-                counter += CountLayers(innerFolder);
-        }*/
+            }
+
+            return true;
+        });
+        
         return counter;
     }