timebasedwidget: snap to workarea

This commit is contained in:
itsmattkc
2022-05-09 16:11:15 -07:00
parent 616121ee7a
commit 1afb33e373
2 changed files with 9 additions and 0 deletions
+8
View File
@@ -782,6 +782,14 @@ bool TimeBasedWidget::SnapPoint(const std::vector<rational> &start_times, ration
}
}
if ((snap_points & kSnapToWorkarea) && ruler()->GetTimelinePoints()) {
const rational &workarea_in = ruler()->GetTimelinePoints()->workarea()->in();
const rational &workarea_out = ruler()->GetTimelinePoints()->workarea()->out();
AttemptSnap(potential_snaps, screen_pt, TimeToScene(workarea_in), start_times, workarea_in);
AttemptSnap(potential_snaps, screen_pt, TimeToScene(workarea_out), start_times, workarea_out);
}
if ((snap_points & kSnapToKeyframes) && GetSnapKeyframes()) {
for (auto it=GetSnapKeyframes()->cbegin(); it!=GetSnapKeyframes()->cend(); it++) {
const QVector<NodeKeyframe*> &keys = (*it)->GetKeyframes();