fixed transition copying

This commit is contained in:
itsmattkc
2018-11-24 13:20:33 +11:00
parent 16ccb4d9c3
commit c5dca79d1d
5 changed files with 81 additions and 60 deletions
+4 -4
View File
@@ -66,8 +66,8 @@ Clip* Clip::copy(Sequence* s) {
}
// TODO make a replacemennt for this somehow
//if (opening_transition != -1) copy->opening_transition = this->sequence->transitions.at(opening_transition)->copy(copy);
//if (closing_transition != -1) copy->closing_transition = this->sequence->transitions.at(closing_transition)->copy(copy);
if (get_opening_transition() != NULL && get_opening_transition()->secondary_clip == NULL) copy->opening_transition = get_opening_transition()->copy(copy, NULL);
if (get_closing_transition() != NULL && get_closing_transition()->secondary_clip == NULL) copy->closing_transition = get_closing_transition()->copy(copy, NULL);
copy->recalculateMaxLength();
@@ -169,8 +169,8 @@ Clip::~Clip() {
}
}
//if (opening_transition != -1) this->sequence->hard_delete_transition(this, TA_OPENING_TRANSITION);
//if (closing_transition != -1) this->sequence->hard_delete_transition(this, TA_CLOSING_TRANSITION);
if (opening_transition != -1) this->sequence->hard_delete_transition(this, TA_OPENING_TRANSITION);
if (closing_transition != -1) this->sequence->hard_delete_transition(this, TA_CLOSING_TRANSITION);
for (int i=0;i<effects.size();i++) {
delete effects.at(i);
+3
View File
@@ -484,6 +484,7 @@ void AddClipCommand::undo() {
Clip* c = seq->clips.last();
panel_timeline->deselect_area(c->timeline_in, c->timeline_out, c->track);
undone_clips.prepend(c);
if (c->open) close_clip(c);
seq->clips.removeLast();
}
mainWindow->setWindowModified(old_project_changed);
@@ -504,6 +505,8 @@ void AddClipCommand::redo() {
for (int j=0;j<original->linked.size();j++) {
copy->linked[j] = original->linked.at(j) + linkOffset;
}
if (original->opening_transition > -1) copy->opening_transition = original->get_opening_transition()->copy(copy, NULL);
if (original->closing_transition > -1) copy->closing_transition = original->get_closing_transition()->copy(copy, NULL);
seq->clips.append(copy);
}
}