-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
/
cmd_move_cel.cpp
48 lines (38 loc) · 951 Bytes
/
cmd_move_cel.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Aseprite
// Copyright (C) 2001-2017 David Capello
//
// This program is distributed under the terms of
// the End-User License Agreement for Aseprite.
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "app/app.h"
#include "app/commands/command.h"
#include "app/context_access.h"
#include "app/ui/timeline/timeline.h"
#include "ui/base.h"
namespace app {
class MoveCelCommand : public Command {
public:
MoveCelCommand();
protected:
bool onEnabled(Context* context) override;
void onExecute(Context* context) override;
};
MoveCelCommand::MoveCelCommand()
: Command(CommandId::MoveCel(), CmdUIOnlyFlag)
{
}
bool MoveCelCommand::onEnabled(Context* context)
{
return App::instance()->timeline()->isMovingCel();
}
void MoveCelCommand::onExecute(Context* context)
{
App::instance()->timeline()->dropRange(Timeline::kMove);
}
Command* CommandFactory::createMoveCelCommand()
{
return new MoveCelCommand;
}
} // namespace app