From 75ecc33bcf7abb93fa96f0be2e5c692b1720101b Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Sun, 26 Nov 2017 22:44:39 -0500 Subject: [PATCH] When creating a new page, set the background grid size to the same as the last active page --- src/adaptors/UBSvgSubsetAdaptor.cpp | 2 -- src/core/UBPersistenceManager.cpp | 1 + src/gui/UBBackgroundPalette.cpp | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/adaptors/UBSvgSubsetAdaptor.cpp b/src/adaptors/UBSvgSubsetAdaptor.cpp index 9ebde9fe..53bef3e1 100644 --- a/src/adaptors/UBSvgSubsetAdaptor.cpp +++ b/src/adaptors/UBSvgSubsetAdaptor.cpp @@ -466,7 +466,6 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene(UBDocumentProx if (!ubGridSize.isNull()) { int gridSize = ubGridSize.toInt(); - UBSettings::settings()->crossSize = gridSize; mScene->setBackgroundGridSize(gridSize); } } @@ -482,7 +481,6 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene(UBDocumentProx if (!ubGridSize.isNull()) { int gridSize = ubGridSize.toInt(); - UBSettings::settings()->crossSize = gridSize; mScene->setBackgroundGridSize(gridSize); } } diff --git a/src/core/UBPersistenceManager.cpp b/src/core/UBPersistenceManager.cpp index 543853b0..f0791119 100644 --- a/src/core/UBPersistenceManager.cpp +++ b/src/core/UBPersistenceManager.cpp @@ -661,6 +661,7 @@ UBGraphicsScene* UBPersistenceManager::createDocumentSceneAt(UBDocumentProxy* pr newScene->setBackground(UBSettings::settings()->isDarkBackground(), UBSettings::settings()->UBSettings::pageBackground()); + newScene->setBackgroundGridSize(UBSettings::settings()->crossSize); persistDocumentScene(proxy, newScene, index); proxy->incPageCount(); diff --git a/src/gui/UBBackgroundPalette.cpp b/src/gui/UBBackgroundPalette.cpp index d10fcc08..4cb6b3b1 100644 --- a/src/gui/UBBackgroundPalette.cpp +++ b/src/gui/UBBackgroundPalette.cpp @@ -134,6 +134,7 @@ void UBBackgroundPalette::showEvent(QShowEvent* event) void UBBackgroundPalette::sliderValueChanged(int value) { UBApplication::boardController->activeScene()->setBackgroundGridSize(value); + UBSettings::settings()->crossSize = value; // since this function is called (indirectly, by refresh) when we switch scenes, the settings will always have the current scene's cross size. } void UBBackgroundPalette::backgroundChanged()