keyframeview: show correct length and jump to the corresponding time in NodeParamView

This commit is contained in:
itsmattkc
2020-04-15 03:35:48 +10:00
parent 7ea8c52c78
commit cc421d4108
8 changed files with 53 additions and 39 deletions
+16 -3
View File
@@ -96,15 +96,23 @@ void TimeBasedWidget::ConnectViewerNode(ViewerOutput *node)
ConnectNodeInternal(viewer_node_);
}
UpdateMaximumScroll();
}
void TimeBasedWidget::UpdateMaximumScroll()
{
if (!viewer_node_ || !auto_max_scrollbar_) {
return;
rational length = (viewer_node_) ? viewer_node_->Length() : rational();
if (auto_max_scrollbar_) {
scrollbar_->setMaximum(qMax(0, qCeil(TimeToScene(length)) - width()));
}
scrollbar_->setMaximum(qMax(0, qCeil(TimeToScene(viewer_node_->Length())) - width()));
foreach (TimelineViewBase* base, timeline_views_) {
base->SetEndTime(length);
}
ruler()->SetCacheStatusLength(length);
}
void TimeBasedWidget::ScrollBarResized(const double &multiplier)
@@ -183,6 +191,11 @@ TimelinePoints *TimeBasedWidget::GetConnectedTimelinePoints() const
return points_;
}
void TimeBasedWidget::ConnectTimelineView(TimelineViewBase *base)
{
timeline_views_.append(base);
}
void TimeBasedWidget::SetTime(int64_t timestamp)
{
ruler_->SetTime(timestamp);