Skip to content

Commit

Permalink
timeline: fix issue where transitions wouldn't reconnect on alt+drag
Browse files Browse the repository at this point in the history
  • Loading branch information
itsmattkc committed Feb 22, 2023
1 parent 48a7172 commit 4801891
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions app/widget/timelinewidget/tool/pointer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -718,13 +718,32 @@ void PointerTool::FinishDrag(TimelineViewMouseEvent *event)

if (!relinks.empty()) {
for (auto it=relinks.cbegin(); it!=relinks.cend(); it++) {
// Re-connect links on duplicate clips
for (auto jt=it.key()->links().cbegin(); jt!=it.key()->links().cend(); jt++) {
Node *link = *jt;
Node *copy_link = relinks.value(link);
if (copy_link) {
command->add_child(new NodeLinkCommand(it.value(), copy_link, true));
}
}

// Re-connect transitions where applicable
if (ClipBlock *og_clip = dynamic_cast<ClipBlock *>(it.key())) {
ClipBlock *cp_clip = static_cast<ClipBlock *>(it.value());

TransitionBlock *og_in_transition = og_clip->in_transition();
TransitionBlock *og_out_transition = og_clip->out_transition();

if (og_in_transition && relinks.contains(og_in_transition)) {
TransitionBlock *cp_in_transition = static_cast<TransitionBlock *>(relinks.value(og_in_transition));
command->add_child(new NodeEdgeAddCommand(cp_clip, NodeInput(cp_in_transition, TransitionBlock::kInBlockInput)));
}

if (og_out_transition && relinks.contains(og_out_transition)) {
TransitionBlock *cp_out_transition = static_cast<TransitionBlock *>(relinks.value(og_out_transition));
command->add_child(new NodeEdgeAddCommand(cp_clip, NodeInput(cp_out_transition, TransitionBlock::kOutBlockInput)));
}
}
}
}

Expand Down

0 comments on commit 4801891

Please sign in to comment.