diff --git a/src/app/cmd/set_grid_bounds.cpp b/src/app/cmd/set_grid_bounds.cpp index 63fc86fea..8011dca50 100644 --- a/src/app/cmd/set_grid_bounds.cpp +++ b/src/app/cmd/set_grid_bounds.cpp @@ -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(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(spr->document()); + auto& docPref = Preferences::instance().document(doc); + docPref.grid.bounds(m_oldBounds); spr->incrementVersion(); } diff --git a/src/app/commands/cmd_grid.cpp b/src/app/commands/cmd_grid.cpp index ee2f00e8c..4dff7bda3 100644 --- a/src/app/commands/cmd_grid.cpp +++ b/src/app/commands/cmd_grid.cpp @@ -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); }