diff --git a/src/app/file/ase_format.cpp b/src/app/file/ase_format.cpp index 86b09034b..fb2d436f2 100644 --- a/src/app/file/ase_format.cpp +++ b/src/app/file/ase_format.cpp @@ -14,7 +14,6 @@ #include "app/file/file.h" #include "app/file/file_format.h" #include "app/file/format_options.h" -#include "app/pref/preferences.h" #include "base/cfile.h" #include "base/exception.h" #include "base/file_handle.h" @@ -65,7 +64,7 @@ public: } doc::color_t defaultSliceColor() override { - auto color = Preferences::instance().slices.defaultColor(); + auto color = m_fop->config().defaultSliceColor; return doc::rgba(color.getRed(), color.getGreen(), color.getBlue(), diff --git a/src/app/file/file.h b/src/app/file/file.h index 98b773f78..378330600 100644 --- a/src/app/file/file.h +++ b/src/app/file/file.h @@ -1,5 +1,5 @@ // Aseprite -// Copyright (C) 2018-2022 Igara Studio S.A. +// Copyright (C) 2018-2023 Igara Studio S.A. // Copyright (C) 2001-2018 David Capello // // This program is distributed under the terms of @@ -260,6 +260,7 @@ namespace app { bool hasEmbeddedGridBounds() const { return m_embeddedGridBounds; } bool newBlend() const { return m_config.newBlend; } + const FileOpConfig& config() const { return m_config; } private: FileOp(); // Undefined diff --git a/src/app/file/file_op_config.cpp b/src/app/file/file_op_config.cpp index e045f5acb..d7d485312 100644 --- a/src/app/file/file_op_config.cpp +++ b/src/app/file/file_op_config.cpp @@ -16,13 +16,15 @@ namespace app { void FileOpConfig::fillFromPreferences() { - preserveColorProfile = Preferences::instance().color.manage(); - filesWithProfile = Preferences::instance().color.filesWithProfile(); - missingProfile = Preferences::instance().color.missingProfile(); - newBlend = Preferences::instance().experimental.newBlend(); - defaultSliceColor = Preferences::instance().slices.defaultColor(); + auto& pref = Preferences::instance(); + + preserveColorProfile = pref.color.manage(); + filesWithProfile = pref.color.filesWithProfile(); + missingProfile = pref.color.missingProfile(); + newBlend = pref.experimental.newBlend(); + defaultSliceColor = pref.slices.defaultColor(); workingCS = get_working_rgb_space_from_preferences(); - rgbMapAlgorithm = Preferences::instance().quantization.rgbmapAlgorithm(); + rgbMapAlgorithm = pref.quantization.rgbmapAlgorithm(); } } // namespace app