updated timeline tools to allow rounding as well as flooring to find the frame

at the mouse cursor point
This commit is contained in:
itsmattkc
2020-01-02 04:11:50 +11:00
parent e8fddc2d5b
commit ae71b206cd
11 changed files with 101 additions and 54 deletions
@@ -11,15 +11,15 @@ TimelineWidget::TransitionTool::TransitionTool(TimelineWidget *parent) :
void TimelineWidget::TransitionTool::MousePress(TimelineViewMouseEvent *event)
{
const TrackReference& track = event->GetCoordinates().GetTrack();
const TrackReference& track = event->GetTrack();
TrackOutput* t = parent()->GetTrackFromReference(track);
rational cursor_frame = event->GetCoordinates().GetFrame();
rational cursor_frame = event->GetFrame();
if (!t || t->IsLocked()) {
return;
}
Block* block_at_time = t->BlockAtTime(event->GetCoordinates().GetFrame());
Block* block_at_time = t->BlockAtTime(event->GetFrame());
if (!block_at_time || block_at_time->type() != Block::kClip) {
return;
}
@@ -78,7 +78,7 @@ void TimelineWidget::TransitionTool::MouseMove(TimelineViewMouseEvent *event)
return;
}
MouseMoveInternal(event->GetCoordinates().GetFrame(), dual_transition_);
MouseMoveInternal(event->GetFrame(), dual_transition_);
}
void TimelineWidget::TransitionTool::MouseRelease(TimelineViewMouseEvent *event)