reworked and vastly improved snapping subsystem
This commit is contained in:
@@ -79,7 +79,7 @@ void AddTool::MousePress(TimelineViewMouseEvent *event)
|
||||
ghost_->SetTrack(track);
|
||||
parent()->AddGhost(ghost_);
|
||||
|
||||
snap_points_.append(drag_start_point_);
|
||||
snap_points_.push_back(drag_start_point_);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -243,8 +243,8 @@ void ImportTool::FootageToGhosts(rational ghost_start, const DraggedFootageData
|
||||
ghost->SetMediaIn(ghost_in);
|
||||
ghost->SetTrack(Track::Reference(track_type, track_offsets.at(track_type)));
|
||||
|
||||
snap_points_.append(ghost->GetIn());
|
||||
snap_points_.append(ghost->GetOut());
|
||||
snap_points_.push_back(ghost->GetIn());
|
||||
snap_points_.push_back(ghost->GetOut());
|
||||
|
||||
// Increment track count for this track type
|
||||
track_offsets[track_type]++;
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include "pointer.h"
|
||||
#include "widget/nodeview/nodeviewundo.h"
|
||||
#include "widget/timelinewidget/undo/timelineundopointer.h"
|
||||
#include "widget/timeruler/timeruler.h"
|
||||
|
||||
namespace olive {
|
||||
|
||||
@@ -793,14 +794,14 @@ void PointerTool::AddGhostInternal(TimelineViewGhostItem* ghost, Timeline::Movem
|
||||
// Prepare snap points (optimizes snapping for later)
|
||||
switch (mode) {
|
||||
case Timeline::kMove:
|
||||
snap_points_.append(ghost->GetIn());
|
||||
snap_points_.append(ghost->GetOut());
|
||||
snap_points_.push_back(ghost->GetIn());
|
||||
snap_points_.push_back(ghost->GetOut());
|
||||
break;
|
||||
case Timeline::kTrimIn:
|
||||
snap_points_.append(ghost->GetIn());
|
||||
snap_points_.push_back(ghost->GetIn());
|
||||
break;
|
||||
case Timeline::kTrimOut:
|
||||
snap_points_.append(ghost->GetOut());
|
||||
snap_points_.push_back(ghost->GetOut());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -78,7 +78,7 @@ protected:
|
||||
|
||||
void InsertGapsAtGhostDestination(MultiUndoCommand* command);
|
||||
|
||||
QVector<rational> snap_points_;
|
||||
std::vector<rational> snap_points_;
|
||||
|
||||
bool dragging_;
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ void TransitionTool::MousePress(TimelineViewMouseEvent *event)
|
||||
|
||||
parent()->AddGhost(ghost_);
|
||||
|
||||
snap_points_.append(transition_start_point);
|
||||
snap_points_.push_back(transition_start_point);
|
||||
|
||||
// Set the drag start point
|
||||
drag_start_point_ = event->GetFrame();
|
||||
|
||||
Reference in New Issue
Block a user