1 | // Aseprite |
2 | // Copyright (C) 2016 David Capello |
3 | // |
4 | // This program is distributed under the terms of |
5 | // the End-User License Agreement for Aseprite. |
6 | |
7 | #ifndef APP_CMD_SET_PIXEL_RATIO_H_INCLUDED |
8 | #define APP_CMD_SET_PIXEL_RATIO_H_INCLUDED |
9 | #pragma once |
10 | |
11 | #include "app/cmd.h" |
12 | #include "app/cmd/with_sprite.h" |
13 | #include "doc/pixel_ratio.h" |
14 | |
15 | namespace doc { |
16 | class Sprite; |
17 | } |
18 | |
19 | namespace app { |
20 | namespace cmd { |
21 | using namespace doc; |
22 | |
23 | class SetPixelRatio : public Cmd |
24 | , public WithSprite { |
25 | public: |
26 | SetPixelRatio(Sprite* sprite, PixelRatio pixelRatio); |
27 | |
28 | protected: |
29 | void onExecute() override; |
30 | void onUndo() override; |
31 | void onFireNotifications() override; |
32 | size_t onMemSize() const override { |
33 | return sizeof(*this); |
34 | } |
35 | |
36 | private: |
37 | PixelRatio m_oldRatio; |
38 | PixelRatio m_newRatio; |
39 | }; |
40 | |
41 | } // namespace cmd |
42 | } // namespace app |
43 | |
44 | #endif |
45 | |