mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-30 06:32:42 +00:00
Copy background & grid preferences to the exported sprite sheet
This commit is contained in:
parent
6dfc45ca31
commit
dc33cf754b
@ -787,6 +787,15 @@ void ExportSpriteSheetCommand::onExecute(Context* context)
|
||||
if (statusbar)
|
||||
statusbar->showTip(1000, "Sprite Sheet Generated");
|
||||
|
||||
// Copy background and grid preferences
|
||||
{
|
||||
DocumentPreferences& newDocPref(Preferences::instance().document(newDocument));
|
||||
newDocPref.bg = docPref.bg;
|
||||
newDocPref.grid = docPref.grid;
|
||||
newDocPref.pixelGrid = docPref.pixelGrid;
|
||||
Preferences::instance().removeDocument(newDocument);
|
||||
}
|
||||
|
||||
if (docPref.spriteSheet.openGenerated()) {
|
||||
newDocument->setContext(context);
|
||||
newDocument.release();
|
||||
|
@ -113,7 +113,7 @@ DocumentPreferences& Preferences::document(const app::Document* document)
|
||||
}
|
||||
}
|
||||
|
||||
void Preferences::onRemoveDocument(doc::Document* doc)
|
||||
void Preferences::removeDocument(doc::Document* doc)
|
||||
{
|
||||
ASSERT(dynamic_cast<app::Document*>(doc));
|
||||
|
||||
@ -125,6 +125,11 @@ void Preferences::onRemoveDocument(doc::Document* doc)
|
||||
}
|
||||
}
|
||||
|
||||
void Preferences::onRemoveDocument(doc::Document* doc)
|
||||
{
|
||||
removeDocument(doc);
|
||||
}
|
||||
|
||||
std::string Preferences::docConfigFileName(const app::Document* doc)
|
||||
{
|
||||
if (!doc)
|
||||
|
@ -55,6 +55,11 @@ namespace app {
|
||||
ToolPreferences& tool(tools::Tool* tool);
|
||||
DocumentPreferences& document(const app::Document* doc);
|
||||
|
||||
// Remove one document explicitly (this can be used if the
|
||||
// document used in Preferences::document() function wasn't member
|
||||
// of UIContext.
|
||||
void removeDocument(doc::Document* doc);
|
||||
|
||||
protected:
|
||||
void onRemoveDocument(doc::Document* doc) override;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user