Correctly create screenshot directory if it does not exist (#551)

This commit is contained in:
Tom Lally 2022-12-03 16:57:32 +00:00 committed by GitHub
parent b361b154d8
commit dd538d477c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -145,7 +145,7 @@ void Renderer::SaveScreenshot(const std::vector<uint8>& rgb_data, int width, int
{
fs::path screendir = _GenerateScreenshotFilename(!mainWindow);
if (!fs::exists(screendir.parent_path()))
fs::create_directory(screendir);
fs::create_directories(screendir.parent_path());
if (image.SaveFile(screendir.wstring()))
{
if(mainWindow)