Commit c5f9379b authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Fix same track transition erratic resize

parent 85201ee8
...@@ -419,9 +419,9 @@ Rectangle { ...@@ -419,9 +419,9 @@ Rectangle {
mixCutPos.anchors.right = undefined mixCutPos.anchors.right = undefined
} }
onReleased: { onReleased: {
controller.resizeStartMix(clipRoot.clipId, Math.round(Math.max(0, x) / clipRoot.timeScale), mouse.modifiers & Qt.ShiftModifier)
root.autoScrolling = timeline.autoScroll root.autoScrolling = timeline.autoScroll
if (sizeChanged) { if (sizeChanged) {
controller.resizeStartMix(clipRoot.clipId, Math.round(Math.max(0, x) / clipRoot.timeScale), mouse.modifiers & Qt.ShiftModifier)
sizeChanged = false sizeChanged = false
} }
anchors.left = parent.left anchors.left = parent.left
...@@ -436,8 +436,6 @@ Rectangle { ...@@ -436,8 +436,6 @@ Rectangle {
if (currentFrame != previousMix) { if (currentFrame != previousMix) {
parent.width = currentFrame * clipRoot.timeScale parent.width = currentFrame * clipRoot.timeScale
sizeChanged = true sizeChanged = true
//TODO: resize mix's other clip
//clipRoot.trimmingIn(clipRoot, newDuration, mouse, shiftTrim, controlTrim)
} }
if (x < mixCutPos.x) { if (x < mixCutPos.x) {
// This will delete the mix // This will delete the mix
......
...@@ -63,6 +63,7 @@ MixStackView::MixStackView(QWidget *parent) ...@@ -63,6 +63,7 @@ MixStackView::MixStackView(QWidget *parent)
m_durationLayout->addWidget(m_alignRight); m_durationLayout->addWidget(m_alignRight);
m_durationLayout->addWidget(m_alignCenter); m_durationLayout->addWidget(m_alignCenter);
m_durationLayout->addWidget(m_alignLeft); m_durationLayout->addWidget(m_alignLeft);
connect(m_duration, &TimecodeDisplay::timeCodeUpdated, this, &MixStackView::updateDuration);
} }
void MixStackView::setModel(const std::shared_ptr<AssetParameterModel> &model, QSize frameSize, bool addSpacer) void MixStackView::setModel(const std::shared_ptr<AssetParameterModel> &model, QSize frameSize, bool addSpacer)
...@@ -82,11 +83,15 @@ void MixStackView::setModel(const std::shared_ptr<AssetParameterModel> &model, Q ...@@ -82,11 +83,15 @@ void MixStackView::setModel(const std::shared_ptr<AssetParameterModel> &model, Q
pCore->getMonitor(m_model->monitorId)->slotShowEffectScene(needsMonitorEffectScene()); pCore->getMonitor(m_model->monitorId)->slotShowEffectScene(needsMonitorEffectScene());
if (m_model->rowCount() > 0) { if (m_model->rowCount() > 0) {
QSignalBlocker bk0(m_duration);
m_duration->setValue(m_model->data(m_model->index(0, 0), AssetParameterModel::ParentDurationRole).toInt()); m_duration->setValue(m_model->data(m_model->index(0, 0), AssetParameterModel::ParentDurationRole).toInt());
connect(m_model.get(), &AssetParameterModel::dataChanged, this, &MixStackView::durationChanged); connect(m_model.get(), &AssetParameterModel::dataChanged, this, &MixStackView::durationChanged);
} }
int mainClipId = stackOwner().second; int mainClipId = stackOwner().second;
MixAlignment align = pCore->getMixAlign(mainClipId); MixAlignment align = pCore->getMixAlign(mainClipId);
QSignalBlocker bk1(m_alignLeft);
QSignalBlocker bk2(m_alignRight);
QSignalBlocker bk3(m_alignCenter);
m_alignLeft->setChecked(false); m_alignLeft->setChecked(false);
m_alignRight->setChecked(false); m_alignRight->setChecked(false);
m_alignCenter->setChecked(false); m_alignCenter->setChecked(false);
...@@ -105,16 +110,15 @@ void MixStackView::setModel(const std::shared_ptr<AssetParameterModel> &model, Q ...@@ -105,16 +110,15 @@ void MixStackView::setModel(const std::shared_ptr<AssetParameterModel> &model, Q
break; break;
} }
m_model->data(m_model->index(0, 0), AssetParameterModel::ParentDurationRole).toInt(); m_model->data(m_model->index(0, 0), AssetParameterModel::ParentDurationRole).toInt();
connect(m_duration, &TimecodeDisplay::timeCodeUpdated, this, &MixStackView::updateDuration);
m_lay->addLayout(m_durationLayout); m_lay->addLayout(m_durationLayout);
m_lay->addStretch(10); m_lay->addStretch(10);
slotRefresh(); slotRefresh();
} }
void MixStackView::durationChanged(const QModelIndex &, const QModelIndex &, const QVector<int> &roles) void MixStackView::durationChanged(const QModelIndex &, const QModelIndex &, const QVector<int> &roles)
{ {
if (roles.contains(AssetParameterModel::ParentDurationRole)) { if (roles.contains(AssetParameterModel::ParentDurationRole)) {
QSignalBlocker bk1(m_duration);
m_duration->setValue(m_model->data(m_model->index(0, 0), AssetParameterModel::ParentDurationRole).toInt()); m_duration->setValue(m_model->data(m_model->index(0, 0), AssetParameterModel::ParentDurationRole).toInt());
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment