mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-04 08:46:09 +00:00
fixed restoring grid preference on undo/redo (fix #2872)
This commit is contained in:
parent
dc1c41f176
commit
f85f24e847
@ -13,6 +13,7 @@
|
||||
#include "app/doc.h"
|
||||
#include "app/doc_event.h"
|
||||
#include "app/doc_observer.h"
|
||||
#include "app/pref/preferences.h"
|
||||
#include "doc/sprite.h"
|
||||
|
||||
namespace app {
|
||||
@ -31,6 +32,9 @@ void SetGridBounds::onExecute()
|
||||
{
|
||||
Sprite* spr = sprite();
|
||||
spr->setGridBounds(m_newBounds);
|
||||
Doc* doc = static_cast<Doc*>(spr->document());
|
||||
auto& docPref = Preferences::instance().document(doc);
|
||||
docPref.grid.bounds(m_newBounds);
|
||||
spr->incrementVersion();
|
||||
}
|
||||
|
||||
@ -38,6 +42,9 @@ void SetGridBounds::onUndo()
|
||||
{
|
||||
Sprite* spr = sprite();
|
||||
spr->setGridBounds(m_oldBounds);
|
||||
Doc* doc = static_cast<Doc*>(spr->document());
|
||||
auto& docPref = Preferences::instance().document(doc);
|
||||
docPref.grid.bounds(m_oldBounds);
|
||||
spr->incrementVersion();
|
||||
}
|
||||
|
||||
|
@ -131,7 +131,6 @@ void GridSettingsCommand::onExecute(Context* context)
|
||||
tx.commit();
|
||||
|
||||
auto& docPref = Preferences::instance().document(site.document());
|
||||
docPref.grid.bounds(bounds);
|
||||
if (!docPref.show.grid()) // Make grid visible
|
||||
docPref.show.grid(true);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user