add history to layer create, delete, move, rename, and merge

This commit is contained in:
2019-06-18 17:39:35 +02:00
parent c48a6da8a6
commit 9ee4bc42b9
12 changed files with 259 additions and 137 deletions

View File

@@ -94,9 +94,8 @@ public:
std::unique_ptr<Stroke> m_current_stroke;
std::unique_ptr<Stroke> m_dual_stroke;
bool m_show_tmp = false;
std::vector<std::unique_ptr<Layer>> m_layers;
std::vector<std::shared_ptr<Layer>> m_layers;
Layer m_layers_merge;
std::vector<int> m_order;
std::vector<glm::vec2> m_plane_shape[6]; // screen space projection of the plane
glm::mat4 m_plane_unproject[6] = SIXPLETTE(glm::mat4(1));
glm::vec3 m_plane_dir[6] = SIXPLETTE(glm::vec3(0));
@@ -164,7 +163,7 @@ public:
bool create(int width, int height);
void resize(int width, int height);
void layer_remove(int idx);
void layer_add(std::string name, std::unique_ptr<Layer> layer = nullptr, int index = 0);
void layer_add(std::string name, std::shared_ptr<Layer> layer = nullptr, int index = 0);
void layer_order(int idx, int pos);
void layer_merge(int source_idx, int dest_idx);
void stroke_start(glm::vec3 point, float pressure);