fixed effect context menu linking

This commit is contained in:
itsmattkc
2019-03-17 08:48:07 +11:00
parent 918ab6132d
commit 789b751935
3 changed files with 91 additions and 65 deletions
+12 -2
View File
@@ -415,9 +415,14 @@ void Effect::delete_self() {
}
void Effect::move_up() {
int index_of_effect = parent_clip->IndexOfEffect(this);
if (index_of_effect == 0) {
return;
}
MoveEffectCommand* command = new MoveEffectCommand();
command->clip = parent_clip;
command->from = parent_clip->IndexOfEffect(this);
command->from = index_of_effect;
command->to = command->from - 1;
olive::UndoStack.push(command);
panel_effect_controls->Reload();
@@ -425,9 +430,14 @@ void Effect::move_up() {
}
void Effect::move_down() {
int index_of_effect = parent_clip->IndexOfEffect(this);
if (index_of_effect == parent_clip->effects.size()-1) {
return;
}
MoveEffectCommand* command = new MoveEffectCommand();
command->clip = parent_clip;
command->from = parent_clip->IndexOfEffect(this);
command->from = index_of_effect;
command->to = command->from + 1;
olive::UndoStack.push(command);
panel_effect_controls->Reload();