Replace all backslashes with forward slashes when loading SVG icons

This commit is contained in:
Yousef Khadadeh 2025-11-21 10:44:40 +03:00
parent aca539600c
commit 45e7910190

View file

@ -59,6 +59,7 @@ void Toolbar::load_icons_at(const std::filesystem::path& pathToLoad) {
for(auto& iconDirEntry : std::filesystem::recursive_directory_iterator(pathToLoad)) {
if(iconDirEntry.is_regular_file()) {
std::string iconRelativePath = iconDirEntry.path().relative_path().string();
std::replace(iconRelativePath.begin(), iconRelativePath.end(), '\\', '/');
auto stream = SkStream::MakeFromFile(iconRelativePath.c_str());
if(!stream)
throw std::runtime_error("[Toolbar::Toolbar] Could not open file " + iconRelativePath);