animated layer merge warning, fix timeline update on document open

This commit is contained in:
2019-11-17 17:57:09 +01:00
parent 3b69ff4ae2
commit 7b63e5d2ce
2 changed files with 16 additions and 6 deletions

View File

@@ -1206,10 +1206,17 @@ void App::init_menu_layer()
popup->find<NodeButtonCustom>("layer-merge")->on_click = [this, popup](Node*) {
//layers->get_child_index(layers->)
int current_idx_order = Canvas::I->m_current_layer_idx;
if (current_idx_order > 0)
if (Canvas::I->anim_duration() > 1)
{
layers->merge(current_idx_order, current_idx_order - 1, true);
message_box("Not supported", "Merging animated layers is not supported yet.");
}
else
{
int current_idx_order = Canvas::I->m_current_layer_idx;
if (current_idx_order > 0)
{
layers->merge(current_idx_order, current_idx_order - 1, true);
}
}
popup->mouse_release();
popup->destroy();

View File

@@ -2560,9 +2560,12 @@ bool Canvas::project_open_thread(std::string file_path)
if (App::I->layout.m_loaded)
{
pb->destroy();
App::I->title_update();
App::I->update_rec_frames();
App::I->animation->load_layers();
App::I->ui_task([] {
App::I->title_update();
App::I->update_rec_frames();
Canvas::I->anim_update();
App::I->animation->load_layers();
});
}
return true;
}