implemented vertical "zooming" in the TimelineWidget and CurveView

This comes in the form of changing the vertical scale in the CurveView and
adjusting all track heights in the Timeline.
This commit is contained in:
itsmattkc
2019-12-31 00:23:28 +11:00
parent 441555e9f2
commit 2b24fae26f
22 changed files with 220 additions and 41 deletions
@@ -473,6 +473,34 @@ void TimelineWidget::DeleteSelected()
Core::instance()->undo_stack()->pushIfHasChildren(command);
}
void TimelineWidget::IncreaseTrackHeight()
{
if (!timeline_node_) {
return;
}
QVector<TrackOutput*> all_tracks = timeline_node_->Tracks();
// Increase the height of each track by one "unit"
foreach (TrackOutput* t, all_tracks) {
t->SetTrackHeight(t->GetTrackHeight() + t->GetTrackHeightIncrement());
}
}
void TimelineWidget::DecreaseTrackHeight()
{
if (!timeline_node_) {
return;
}
QVector<TrackOutput*> all_tracks = timeline_node_->Tracks();
// Decrease the height of each track by one "unit"
foreach (TrackOutput* t, all_tracks) {
t->SetTrackHeight(qMax(t->GetTrackHeight() - t->GetTrackHeightIncrement(), t->GetTrackHeightMinimum()));
}
}
QList<TimelineViewBlockItem *> TimelineWidget::GetSelectedBlocks()
{
QList<TimelineViewBlockItem *> list;