implemented transition moving
For dual transitions, this will shift around the mid point.
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
#include <float.h>
|
||||
|
||||
#include "common/range.h"
|
||||
#include "node/block/transition/transition.h"
|
||||
|
||||
TimelineWidget::Tool::Tool(TimelineWidget *parent) :
|
||||
dragging_(false),
|
||||
@@ -101,6 +102,23 @@ rational TimelineWidget::Tool::ValidateFrameMovement(rational movement, const QV
|
||||
continue;
|
||||
}
|
||||
|
||||
Block* block = Node::ValueToPtr<Block>(ghost->data(TimelineViewGhostItem::kAttachedBlock));
|
||||
|
||||
if (block && block->type() == Block::kTransition) {
|
||||
TransitionBlock* transition = static_cast<TransitionBlock*>(block);
|
||||
|
||||
// Daul transitions are only allowed to move so that neither of their offsets are < 0
|
||||
if (transition->connected_in_block() && transition->connected_out_block()) {
|
||||
if (movement > transition->out_offset()) {
|
||||
movement = transition->out_offset();
|
||||
}
|
||||
|
||||
if (movement < -transition->in_offset()) {
|
||||
movement = -transition->in_offset();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Prevents any ghosts from going below 0:00:00 time
|
||||
if (ghost->In() + movement < 0) {
|
||||
movement = -ghost->In();
|
||||
|
||||
Reference in New Issue
Block a user