timeruler: add ability to resize markers and workarea

This commit is contained in:
itsmattkc
2022-05-09 17:53:21 -07:00
parent 7d370320d8
commit 0f99d8a662
8 changed files with 218 additions and 23 deletions
+7 -2
View File
@@ -486,7 +486,7 @@ void TimeBasedWidget::SetPoint(Timeline::MovementMode m, const rational& time)
}
// Set workarea
command->add_child(new WorkareaSetRangeCommand(viewer_node_->project(), points, TimeRange(in_point, out_point)));
command->add_child(new WorkareaSetRangeCommand(points->workarea(), TimeRange(in_point, out_point)));
Core::instance()->undo_stack()->push(command);
}
@@ -511,7 +511,7 @@ void TimeBasedWidget::ResetPoint(Timeline::MovementMode m)
r.set_out(TimelineWorkArea::kResetOut);
}
Core::instance()->undo_stack()->push(new WorkareaSetRangeCommand(viewer_node_->project(), points, r));
Core::instance()->undo_stack()->push(new WorkareaSetRangeCommand(points->workarea(), r));
}
void TimeBasedWidget::PageScrollInternal(QScrollBar *bar, int maximum, int screen_position, bool whole_page_scroll)
@@ -772,6 +772,11 @@ bool TimeBasedWidget::SnapPoint(const std::vector<rational> &start_times, ration
for (auto it=ruler()->GetTimelinePoints()->markers()->cbegin(); it!=ruler()->GetTimelinePoints()->markers()->cend(); it++) {
TimelineMarker* m = *it;
// Ignore selected markers
if (std::find(ruler()->GetSelectedMarkers().cbegin(), ruler()->GetSelectedMarkers().cend(), m) != ruler()->GetSelectedMarkers().cend()) {
continue;
}
qreal marker_pos = TimeToScene(m->time_range().in());
AttemptSnap(potential_snaps, screen_pt, marker_pos, start_times, m->time_range().in());