Fix crash changing states from Undo History window when we've removed layers

This commit is contained in:
David Capello 2019-04-24 10:17:12 -03:00
parent e197a8670c
commit a2d9f3fc76
2 changed files with 6 additions and 0 deletions

View File

@ -1748,7 +1748,12 @@ void Timeline::onBeforeRemoveLayer(DocEvent& ev)
setLayer(layer_select);
}
}
// We have to regenerate the layer rows (m_rows) after the layer is
// removed from the sprite.
void Timeline::onAfterRemoveLayer(DocEvent& ev)
{
regenerateRows();
showCurrentCel();
clearClipboardRange();

View File

@ -142,6 +142,7 @@ namespace app {
void onGeneralUpdate(DocEvent& ev) override;
void onAddLayer(DocEvent& ev) override;
void onBeforeRemoveLayer(DocEvent& ev) override;
void onAfterRemoveLayer(DocEvent& ev) override;
void onAddFrame(DocEvent& ev) override;
void onRemoveFrame(DocEvent& ev) override;
void onSelectionBoundariesChanged(DocEvent& ev) override;