diff --git a/Sandbox/src/Editor/Panels/ContentBroswerPanel.cpp b/Sandbox/src/Editor/Panels/ContentBroswerPanel.cpp index 10f2ada..d7646ea 100644 --- a/Sandbox/src/Editor/Panels/ContentBroswerPanel.cpp +++ b/Sandbox/src/Editor/Panels/ContentBroswerPanel.cpp @@ -50,8 +50,7 @@ namespace Hazel for (auto& directory : std::filesystem::directory_iterator(m_CurrentDirectory)) { auto& path = directory.path(); - auto relativePath = std::filesystem::relative(directory.path(), g_AssetPath); - std::string filePathString = relativePath.filename().string(); + std::string filePathString = path.filename().string(); ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0)); @@ -61,6 +60,7 @@ namespace Hazel if (ImGui::BeginDragDropSource()) { + auto relativePath = std::filesystem::relative(path, g_AssetPath); const wchar_t* itemPath = relativePath.c_str(); ImGui::SetDragDropPayload("CONTENT_BROSWER_ITEM", itemPath, (wcslen(itemPath) + 1) * sizeof(wchar_t), ImGuiCond_Once); ImGui::EndDragDropSource();