From e5797e98774f23dc12633dfae26a49d7b5d8b4ef Mon Sep 17 00:00:00 2001 From: emerycp Date: Fri, 7 Jul 2023 16:33:52 -0400 Subject: [PATCH 1/2] File browser doesn't display 1st element --- Editor/src/Windows/FileSystemUI.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Editor/src/Windows/FileSystemUI.cpp b/Editor/src/Windows/FileSystemUI.cpp index 5d6e70ac..5fafc2d2 100644 --- a/Editor/src/Windows/FileSystemUI.cpp +++ b/Editor/src/Windows/FileSystemUI.cpp @@ -322,7 +322,6 @@ namespace Nuake { ImGui::TableNextColumn(); if (ImGui::Button("..", ImVec2(100, 100))) m_CurrentDirectory = m_CurrentDirectory->Parent; - ImGui::TableNextColumn(); i++; } @@ -330,13 +329,12 @@ namespace Nuake { { for (Ref& d : m_CurrentDirectory->Directories) { - DrawDirectory(d); if (i + 1 % amount != 0) ImGui::TableNextColumn(); else ImGui::TableNextRow(); - + DrawDirectory(d); i++; } } @@ -345,12 +343,11 @@ namespace Nuake { { for (auto f : m_CurrentDirectory->Files) { - DrawFile(f); - - if (i - 1 % amount != 0) + if (i - 1 % amount != 0 || i == 1) ImGui::TableNextColumn(); else ImGui::TableNextRow(); + DrawFile(f); i++; } } From 609fa312b45d8a2103985824ec2447a17deadc16 Mon Sep 17 00:00:00 2001 From: Antoine Pilote Date: Fri, 7 Jul 2023 20:38:17 +0000 Subject: [PATCH 2/2] Formatting --- Editor/src/Windows/FileSystemUI.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Editor/src/Windows/FileSystemUI.cpp b/Editor/src/Windows/FileSystemUI.cpp index 5fafc2d2..6c5096d6 100644 --- a/Editor/src/Windows/FileSystemUI.cpp +++ b/Editor/src/Windows/FileSystemUI.cpp @@ -329,11 +329,11 @@ namespace Nuake { { for (Ref& d : m_CurrentDirectory->Directories) { - if (i + 1 % amount != 0) ImGui::TableNextColumn(); else ImGui::TableNextRow(); + DrawDirectory(d); i++; } @@ -347,6 +347,7 @@ namespace Nuake { ImGui::TableNextColumn(); else ImGui::TableNextRow(); + DrawFile(f); i++; }