File indexing completed on 2024-12-22 04:10:01

0001 /*
0002  *  SPDX-FileCopyrightText: 2017 Nikita Smirnov <pakrentos@gmail.com>
0003  *
0004  *  SPDX-License-Identifier: GPL-2.0-or-later
0005  */
0006 
0007 
0008 #include "kis_image_commands.h"
0009 #include "kis_image.h"
0010 #include "kis_node.h"
0011 
0012 #include <klocalizedstring.h>
0013 
0014 
0015 KisImageChangeVisibilityCommand::KisImageChangeVisibilityCommand(bool visibility, KisNodeSP node)
0016     : KUndo2Command(kundo2_noi18n("change-visibility-command"), 0)
0017 {
0018     m_node = node;
0019     m_visible = visibility;
0020 }
0021 
0022 void KisImageChangeVisibilityCommand::redo()
0023 {
0024     m_node->setVisible(m_visible);
0025 }
0026 
0027 void KisImageChangeVisibilityCommand::undo()
0028 {
0029     m_node->setVisible(!m_visible);
0030 }