improving actions history

This commit is contained in:
2019-06-14 18:46:11 +02:00
parent ac47915658
commit c48a6da8a6
14 changed files with 388 additions and 214 deletions

20
src/canvas_actions.h Normal file
View File

@@ -0,0 +1,20 @@
#pragma once
#include "action.h"
class ActionStroke : public Action
{
public:
//std::unique_ptr<Stroke> m_stroke;
std::unique_ptr<uint8_t[]> m_image[6] = SIXPLETTE(nullptr);
glm::ivec4 m_old_box[6] = SIXPLETTE(glm::ivec4(0));
bool m_old_dirty[6] = SIXPLETTE(false);
glm::ivec4 m_box[6] = SIXPLETTE(glm::ivec4(0));
bool clear_layer = false;
int m_layer_idx = 0;
class Canvas* m_canvas;
virtual ~ActionStroke() = default;
virtual void run() override { }
virtual Action* get_redo() override;
virtual void undo() override;
virtual size_t memory() override;
};