@@ -447,7 +447,8 @@ void TimelineWidget::SplitAtPlayhead()
|
||||
|
||||
void TimelineWidget::ReplaceBlocksWithGaps(const QVector<Block *> &blocks,
|
||||
bool remove_from_graph,
|
||||
MultiUndoCommand *command)
|
||||
MultiUndoCommand *command,
|
||||
bool handle_transitions)
|
||||
{
|
||||
foreach (Block* b, blocks) {
|
||||
if (dynamic_cast<GapBlock*>(b)) {
|
||||
@@ -458,7 +459,7 @@ void TimelineWidget::ReplaceBlocksWithGaps(const QVector<Block *> &blocks,
|
||||
|
||||
Track* original_track = b->track();
|
||||
|
||||
command->add_child(new TrackReplaceBlockWithGapCommand(original_track, b));
|
||||
command->add_child(new TrackReplaceBlockWithGapCommand(original_track, b, handle_transitions));
|
||||
|
||||
if (remove_from_graph) {
|
||||
command->add_child(new NodeRemoveWithExclusiveDependenciesAndDisconnect(b));
|
||||
|
||||
@@ -112,7 +112,7 @@ public:
|
||||
|
||||
void RestoreSplitterState(const QByteArray& state);
|
||||
|
||||
static void ReplaceBlocksWithGaps(const QVector<Block *> &blocks, bool remove_from_graph, MultiUndoCommand *command);
|
||||
static void ReplaceBlocksWithGaps(const QVector<Block *> &blocks, bool remove_from_graph, MultiUndoCommand *command, bool handle_transitions = true);
|
||||
|
||||
/**
|
||||
* @brief Retrieve the QGraphicsItem at a particular scene position
|
||||
|
||||
@@ -591,7 +591,7 @@ void PointerTool::FinishDrag(TimelineViewMouseEvent *event)
|
||||
blocks_to_delete[i] = blocks_moving.at(i).block;
|
||||
}
|
||||
|
||||
parent()->ReplaceBlocksWithGaps(blocks_to_delete, false, command);
|
||||
parent()->ReplaceBlocksWithGaps(blocks_to_delete, false, command, false);
|
||||
}
|
||||
|
||||
if (inserting) {
|
||||
|
||||
@@ -441,7 +441,7 @@ void TrackListInsertGaps::undo()
|
||||
void TrackReplaceBlockWithGapCommand::redo()
|
||||
{
|
||||
// Determine if this block is connected to any transitions that should also be removed by this operation
|
||||
if (transition_remove_commands_.isEmpty()) {
|
||||
if (handle_transitions_ && transition_remove_commands_.isEmpty()) {
|
||||
CreateRemoveTransitionCommandIfNecessary(false);
|
||||
CreateRemoveTransitionCommandIfNecessary(true);
|
||||
}
|
||||
|
||||
@@ -196,12 +196,13 @@ private:
|
||||
|
||||
class TrackReplaceBlockWithGapCommand : public UndoCommand {
|
||||
public:
|
||||
TrackReplaceBlockWithGapCommand(Track* track, Block* block) :
|
||||
TrackReplaceBlockWithGapCommand(Track* track, Block* block, bool handle_transitions = true) :
|
||||
track_(track),
|
||||
block_(block),
|
||||
existing_gap_(nullptr),
|
||||
existing_merged_gap_(nullptr),
|
||||
our_gap_(nullptr),
|
||||
handle_transitions_(handle_transitions),
|
||||
position_command_(nullptr)
|
||||
{
|
||||
}
|
||||
@@ -232,6 +233,8 @@ private:
|
||||
bool existing_gap_precedes_;
|
||||
GapBlock* our_gap_;
|
||||
|
||||
bool handle_transitions_;
|
||||
|
||||
NodeSetPositionAsChildCommand* position_command_;
|
||||
|
||||
QObject memory_manager_;
|
||||
|
||||
Reference in New Issue
Block a user