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#ifndef APP_CMD_SET_SPRITE_SIZE_H_INCLUDED
8#define APP_CMD_SET_SPRITE_SIZE_H_INCLUDED
9#pragma once
10
11#include "app/cmd.h"
12#include "app/cmd/with_sprite.h"
13
14namespace app {
15namespace cmd {
16 using namespace doc;
17
18 class SetSpriteSize : public Cmd
19 , public WithSprite {
20 public:
21 SetSpriteSize(Sprite* sprite, int newWidth, int newHeight);
22
23 protected:
24 void onExecute() override;
25 void onUndo() override;
26 void onFireNotifications() override;
27 size_t onMemSize() const override {
28 return sizeof(*this);
29 }
30
31 private:
32 uint32_t m_oldWidth;
33 uint32_t m_oldHeight;
34 uint32_t m_newWidth;
35 uint32_t m_newHeight;
36 };
37
38} // namespace cmd
39} // namespace app
40
41#endif
42