add history to equirect import

This commit is contained in:
2019-06-26 14:48:23 +02:00
parent a15d3acaef
commit d4551ba647
7 changed files with 102 additions and 15 deletions

View File

@@ -96,3 +96,51 @@ Action* ActionStroke::get_redo()
action->clear_layer = false;
return action;
}
//////////////////////////////////////////////////////////////////////////
Action* ActionLayerClear::get_redo()
{
auto a = new ActionLayerClear;
a->m_direction = reverse_direction();
a->m_snap = m_snap;
a->m_layer = m_layer;
a->m_color = m_color;
return a;
}
void ActionLayerClear::undo()
{
if (m_direction == Direction::Undo)
{
m_layer->restore(*m_snap);
}
else
{
m_layer->clear(m_color);
}
}
//////////////////////////////////////////////////////////////////////////
Action* ActionImportEquirect::get_redo()
{
auto a = new ActionImportEquirect;
a->m_direction = reverse_direction();
a->m_snap = m_snap;
a->m_layer = m_layer;
a->m_path = m_path;
return a;
}
void ActionImportEquirect::undo()
{
if (m_direction == Direction::Undo)
{
m_layer->restore(*m_snap);
}
else
{
Canvas::I->import_equirectangular_thread(m_path, m_layer);
}
}