| 1 | // Aseprite |
|---|---|
| 2 | // Copyright (C) 2019 Igara Studio S.A. |
| 3 | // Copyright (C) 2001-2015 David Capello |
| 4 | // |
| 5 | // This program is distributed under the terms of |
| 6 | // the End-User License Agreement for Aseprite. |
| 7 | |
| 8 | #ifdef HAVE_CONFIG_H |
| 9 | #include "config.h" |
| 10 | #endif |
| 11 | |
| 12 | #include "app/cmd/set_tag_anidir.h" |
| 13 | |
| 14 | #include "doc/tag.h" |
| 15 | |
| 16 | namespace app { |
| 17 | namespace cmd { |
| 18 | |
| 19 | SetTagAniDir::SetTagAniDir(Tag* tag, doc::AniDir anidir) |
| 20 | : WithTag(tag) |
| 21 | , m_oldAniDir(tag->aniDir()) |
| 22 | , m_newAniDir(anidir) |
| 23 | { |
| 24 | } |
| 25 | |
| 26 | void SetTagAniDir::onExecute() |
| 27 | { |
| 28 | tag()->setAniDir(m_newAniDir); |
| 29 | tag()->incrementVersion(); |
| 30 | } |
| 31 | |
| 32 | void SetTagAniDir::onUndo() |
| 33 | { |
| 34 | tag()->setAniDir(m_oldAniDir); |
| 35 | tag()->incrementVersion(); |
| 36 | } |
| 37 | |
| 38 | } // namespace cmd |
| 39 | } // namespace app |
| 40 |