various: extended marker and timeline functionality

This commit is contained in:
itsmattkc
2022-05-01 21:17:22 -07:00
parent cdcd83c09a
commit 6a0b5856c9
23 changed files with 781 additions and 240 deletions
+8 -6
View File
@@ -1798,13 +1798,15 @@ bool TimelineWidget::SnapPoint(QVector<rational> start_times, rational* movement
}
if ((snap_points & kSnapToMarkers)) {
foreach (TimelineMarker* m, GetConnectedNode()->GetTimelinePoints()->markers()->list()) {
qreal marker_pos = TimeToScene(m->time().in());
potential_snaps.append(AttemptSnap(screen_pt, marker_pos, start_times, m->time().in()));
for (auto it=GetConnectedNode()->GetTimelinePoints()->markers()->cbegin(); it!=GetConnectedNode()->GetTimelinePoints()->markers()->cend(); it++) {
TimelineMarker* m = *it;
if (m->time().in() != m->time().out()) {
marker_pos = TimeToScene(m->time().out());
potential_snaps.append(AttemptSnap(screen_pt, marker_pos, start_times, m->time().out()));
qreal marker_pos = TimeToScene(m->time_range().in());
potential_snaps.append(AttemptSnap(screen_pt, marker_pos, start_times, m->time_range().in()));
if (m->time_range().in() != m->time_range().out()) {
marker_pos = TimeToScene(m->time_range().out());
potential_snaps.append(AttemptSnap(screen_pt, marker_pos, start_times, m->time_range().out()));
}
}
}