diff --git a/src/app/commands/cmd_save_file.cpp b/src/app/commands/cmd_save_file.cpp index 029c21b67..db0140ebd 100644 --- a/src/app/commands/cmd_save_file.cpp +++ b/src/app/commands/cmd_save_file.cpp @@ -135,9 +135,11 @@ std::string SaveFileBaseCommand::saveAsDialog( const std::string& forbiddenFilename) { Doc* document = context->activeDocument(); - - // Before to release de original document, we have to save all - // preferences which are not saved in a Close operation: + + // Before we change the document filename to the copy, we save its + // preferences so in a future export operation the values persist, + // and we can re-export the original document with the same + // preferences. Preferences::instance().save(); std::string filename; @@ -173,6 +175,19 @@ std::string SaveFileBaseCommand::saveAsDialog( saveDocumentInBackground( context, document, filename, markAsSaved); + + // Reset the "saveCopy" document preferences of the new document + // (here "document" contains the new filename), because these + // preferences make sense only for the original document that was + // exported/copied, not for the new one. + // + // The new document (the copy) must have the default preferences + // just in case the user want to export it to other file (so a + // proper default export filename is calculated). This scenario is + // described here: + // + // https://github.com/aseprite/aseprite/issues/1964 + // auto& docPref = Preferences::instance().document(document); docPref.saveCopy.filename(docPref.saveCopy.filename.defaultValue()); docPref.saveCopy.aniDir(docPref.saveCopy.aniDir.defaultValue()); diff --git a/src/app/ui/export_file_window.cpp b/src/app/ui/export_file_window.cpp index 85f39c232..dd5d6a006 100644 --- a/src/app/ui/export_file_window.cpp +++ b/src/app/ui/export_file_window.cpp @@ -61,6 +61,12 @@ ExportFileWindow::ExportFileWindow(const Doc* doc) forTwitter()->setSelected(m_docPref.saveCopy.forTwitter()); adjustResize()->setVisible(false); + // Here we don't call updateAniDir() because it's already filled and + // set by the function fill_anidir_combobox(). So if the user + // exported a tag with a specific AniDir, we want to keep the option + // in the preference (instead of the tag's AniDir). + //updateAniDir(); + updateAdjustResizeButton(); outputFilename()->Change.connect(