made pasting effects undoable

This commit is contained in:
itsmattkc
2018-12-02 19:38:38 +11:00
parent 967cc01077
commit fbded93e39
5 changed files with 29 additions and 43 deletions
+10 -1
View File
@@ -973,17 +973,26 @@ void Timeline::paste(bool insert) {
panel_sequence_viewer->seek(paste_end);
}
} else if (clipboard_type == CLIPBOARD_TYPE_EFFECT) {
ComboAction* ca = new ComboAction();
bool push = false;
for (int i=0;i<sequence->clips.size();i++) {
Clip* c = sequence->clips.at(i);
if (c != NULL && is_clip_selected(c, true)) {
for (int j=0;j<clipboard.size();j++) {
Effect* e = static_cast<Effect*>(clipboard.at(j));
if ((c->track < 0) == (e->meta->subtype == EFFECT_TYPE_VIDEO)) {
c->effects.append(e->copy(c));
ca->append(new AddEffectCommand(c, e->copy(c), NULL));
push = true;
}
}
}
}
if (push) {
ca->appendPost(new ReloadEffectsCommand());
undo_stack.push(ca);
} else {
delete ca;
}
update_ui(true);
}
}