File indexing completed on 2025-01-26 04:11:18

0001 /*
0002  * SPDX-FileCopyrightText: 2022 Sharaf Zaman <shzam@sdf.org>
0003  *
0004  * SPDX-License-Identifier: LGPL-2.0-or-later
0005  */
0006 
0007 #include "KisDuplicateOptionData.h"
0008 
0009 #include <kis_properties_configuration.h>
0010 
0011 bool KisDuplicateOptionData::read(const KisPropertiesConfiguration *setting)
0012 {
0013     healing = setting->getBool(DUPLICATE_HEALING, false);
0014     correctPerspective = setting->getBool(DUPLICATE_CORRECT_PERSPECTIVE, false);
0015     moveSourcePoint = setting->getBool(DUPLICATE_MOVE_SOURCE_POINT, true);
0016     resetSourcePoint = setting->getBool(DUPLICATE_RESET_SOURCE_POINT, false);
0017     cloneFromProjection = setting->getBool(DUPLICATE_CLONE_FROM_PROJECTION, false);
0018 
0019     return true;
0020 }
0021 
0022 void KisDuplicateOptionData::write(KisPropertiesConfiguration *setting) const
0023 {
0024     setting->setProperty(DUPLICATE_HEALING, healing);
0025     setting->setProperty(DUPLICATE_CORRECT_PERSPECTIVE, correctPerspective);
0026     setting->setProperty(DUPLICATE_MOVE_SOURCE_POINT, moveSourcePoint);
0027     setting->setProperty(DUPLICATE_RESET_SOURCE_POINT, resetSourcePoint);
0028     setting->setProperty(DUPLICATE_CLONE_FROM_PROJECTION, cloneFromProjection);
0029 }