Show relative path when exporting sprite (fix #4059)

When exporting a file that was already saved, shows the relative path
to the original path instead of only the filename.
This commit is contained in:
Guilherme Marcondes 2024-06-03 21:23:36 +01:00
parent 9fb0ee620c
commit db639072f7
2 changed files with 9 additions and 3 deletions

2
laf

@ -1 +1 @@
Subproject commit ca7739de757ad098e28e33a5e0645b6852c1e929 Subproject commit 36abe0348ccdb00ddbb854ca21e1ae9ce75752f4

View File

@ -192,8 +192,14 @@ void ExportFileWindow::setAniDir(const doc::AniDir aniDir)
void ExportFileWindow::setOutputFilename(const std::string& pathAndFilename) void ExportFileWindow::setOutputFilename(const std::string& pathAndFilename)
{ {
if (base::get_file_path(m_doc->filename()).empty()) {
m_outputPath = base::get_file_path(pathAndFilename); m_outputPath = base::get_file_path(pathAndFilename);
m_outputFilename = base::get_file_name(pathAndFilename); m_outputFilename = base::get_file_name(pathAndFilename);
}
else {
m_outputPath = base::get_file_path(m_doc->filename());
m_outputFilename = base::get_relative_path(pathAndFilename, base::get_file_path(m_doc->filename()));
}
updateOutputFilenameEntry(); updateOutputFilenameEntry();
} }