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
16namespace app {
17namespace cmd {
18
19SetTagAniDir::SetTagAniDir(Tag* tag, doc::AniDir anidir)
20 : WithTag(tag)
21 , m_oldAniDir(tag->aniDir())
22 , m_newAniDir(anidir)
23{
24}
25
26void SetTagAniDir::onExecute()
27{
28 tag()->setAniDir(m_newAniDir);
29 tag()->incrementVersion();
30}
31
32void SetTagAniDir::onUndo()
33{
34 tag()->setAniDir(m_oldAniDir);
35 tag()->incrementVersion();
36}
37
38} // namespace cmd
39} // namespace app
40