fix bucket undo

This commit is contained in:
2019-06-25 14:49:14 +02:00
parent f9cf452af2
commit 5f72f9901f
5 changed files with 18 additions and 12 deletions

View File

@@ -1565,6 +1565,8 @@ void CanvasModeFloodFill::on_MouseEvent(MouseEvent* me, glm::vec2& loc)
{
std::shared_ptr<Layer> m_layer;
std::shared_ptr<Layer::Snapshot> m_snap;
std::array<bool, 6> m_dirty_face = SIXPLETTE(false);
std::array<glm::vec4, 6> m_dirty_box = SIXPLETTE(glm::vec4(0));
glm::ivec2 m_pos;
glm::vec4 m_color;
float m_threshold;
@@ -1583,6 +1585,8 @@ void CanvasModeFloodFill::on_MouseEvent(MouseEvent* me, glm::vec2& loc)
a->m_layer_index = m_layer_index;
a->m_threshold = m_threshold;
a->m_plane = m_plane;
a->m_dirty_box = m_dirty_box;
a->m_dirty_face = m_dirty_face;
return a;
}
virtual void undo() override
@@ -1625,6 +1629,8 @@ void CanvasModeFloodFill::on_MouseEvent(MouseEvent* me, glm::vec2& loc)
a->m_layer_index = Canvas::I->m_current_layer_idx;
a->m_threshold = m_tool->get_threshold();
a->m_plane = plane;
a->m_dirty_box = plane_data.layer->m_dirty_box;
a->m_dirty_face = plane_data.layer->m_dirty_face;
ActionManager::add(a);
plane_data.apply();