From 20d04af64bdd426fcf11529bd3d7d1c52bb34b94 Mon Sep 17 00:00:00 2001 From: itsmattkc <34096995+itsmattkc@users.noreply.github.com> Date: Mon, 16 May 2022 08:47:08 -0700 Subject: [PATCH] timeline: use sequence dimensions for width and height Fixes #1923 --- app/widget/timelinewidget/tool/add.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/app/widget/timelinewidget/tool/add.cpp b/app/widget/timelinewidget/tool/add.cpp index 2dc04f17a..866a384d2 100644 --- a/app/widget/timelinewidget/tool/add.cpp +++ b/app/widget/timelinewidget/tool/add.cpp @@ -105,13 +105,14 @@ void AddTool::MouseRelease(TimelineViewMouseEvent *event) Sequence *s = parent()->sequence(); - // If we want to set a manual rect for something, we can do so here - // - //VideoParams svp = s->GetVideoParams(); - //QRectF r(0, 0, svp.width(), svp.height()); - //r.adjust(svp.width()/10, svp.height()/10, -svp.width()/10, -svp.height()/10); + QRectF r; + if (Core::instance()->GetSelectedAddableObject() == Tool::kAddableTitle) { + VideoParams svp = s->GetVideoParams(); + r = QRectF(0, 0, svp.width(), svp.height()); + r.adjust(svp.width()/10, svp.height()/10, -svp.width()/10, -svp.height()/10); + } - CreateAddableClip(command, s, ghost_->GetTrack(), ghost_->GetAdjustedIn(), ghost_->GetAdjustedLength()); + CreateAddableClip(command, s, ghost_->GetTrack(), ghost_->GetAdjustedIn(), ghost_->GetAdjustedLength(), r); Core::instance()->undo_stack()->push(command); } @@ -125,7 +126,7 @@ void AddTool::MouseRelease(TimelineViewMouseEvent *event) Node *AddTool::CreateAddableClip(MultiUndoCommand *command, Sequence *sequence, const Track::Reference &track, const rational &in, const rational &length, const QRectF &rect) { ClipBlock* clip; - if (Core::instance()->GetSelectedAddableObject() == olive::Tool::kAddableSubtitle) { + if (Core::instance()->GetSelectedAddableObject() == Tool::kAddableSubtitle) { clip = new SubtitleBlock(); } else { clip = new ClipBlock();