1 | // Aseprite |
---|---|
2 | // Copyright (C) 2001-2015 David Capello |
3 | // |
4 | // This program is distributed under the terms of |
5 | // the End-User License Agreement for Aseprite. |
6 | |
7 | #ifdef HAVE_CONFIG_H |
8 | #include "config.h" |
9 | #endif |
10 | |
11 | #include "app/cmd/set_layer_flags.h" |
12 | |
13 | namespace app { |
14 | namespace cmd { |
15 | |
16 | SetLayerFlags::SetLayerFlags(Layer* layer, LayerFlags flags) |
17 | : WithLayer(layer) |
18 | , m_oldFlags(layer->flags()) |
19 | , m_newFlags(flags) |
20 | { |
21 | } |
22 | |
23 | void SetLayerFlags::onExecute() |
24 | { |
25 | layer()->setFlags(m_newFlags); |
26 | layer()->incrementVersion(); |
27 | } |
28 | |
29 | void SetLayerFlags::onUndo() |
30 | { |
31 | layer()->setFlags(m_oldFlags); |
32 | layer()->incrementVersion(); |
33 | } |
34 | |
35 | } // namespace cmd |
36 | } // namespace app |
37 |