Commit 0b650bcf authored by Julius Künzel's avatar Julius Künzel 💬
Browse files

[Mix Stack] Fix wrongly reversed position slider

parent 1a80d0f9
Pipeline #224346 passed with stage
in 10 minutes and 50 seconds
......@@ -1213,9 +1213,9 @@ void Core::testProxies()
dialog->exec();
}
void Core::resizeMix(int cid, int duration, MixAlignment align, int rightFrames)
void Core::resizeMix(int cid, int duration, MixAlignment align, int leftFrames)
{
m_mainWindow->getCurrentTimeline()->controller()->resizeMix(cid, duration, align, rightFrames);
m_mainWindow->getCurrentTimeline()->controller()->resizeMix(cid, duration, align, leftFrames);
}
MixAlignment Core::getMixAlign(int cid) const
......
......@@ -264,7 +264,7 @@ public:
/** @brief The number of clip load jobs changed */
void loadingClips(int);
/** @brief Resize current mix item */
void resizeMix(int cid, int duration, MixAlignment align, int rightFrames = -1);
void resizeMix(int cid, int duration, MixAlignment align, int leftFrames = -1);
/** @brief Get Mix cut pos (the duration of the mix on the right clip) */
int getMixCutPos(int cid) const;
/** @brief Get alignment info for a mix item */
......
......@@ -6254,7 +6254,7 @@ MixAlignment TimelineModel::getMixAlign(int cid) const
return MixAlignment::AlignNone;
}
void TimelineModel::requestResizeMix(int cid, int duration, MixAlignment align, int rightFrames)
void TimelineModel::requestResizeMix(int cid, int duration, MixAlignment align, int leftFrames)
{
Q_ASSERT(isClip(cid));
int tid = m_allClips.at(cid)->getCurrentTrackId();
......@@ -6417,10 +6417,10 @@ void TimelineModel::requestResizeMix(int cid, int duration, MixAlignment align,
// No alignment specified
int updatedDurationRight;
int updatedDurationLeft;
if (rightFrames > -1) {
if (leftFrames > -1) {
// A right frame offset was specified
updatedDurationRight = qBound(0, rightFrames, duration);
updatedDurationLeft = duration - updatedDurationRight;
updatedDurationLeft = qBound(0, leftFrames, duration);
updatedDurationRight = duration - updatedDurationLeft;
} else {
updatedDurationRight = m_allClips.at(cid)->getMixCutPosition();
updatedDurationLeft = m_allClips.at(cid)->getMixDuration() - updatedDurationRight;
......
......@@ -789,7 +789,7 @@ public:
/** @brief Create a mix selection with currently selected clip. If delta = -1, mix with previous clip, +1 with next clip and 0 will check cursor position*/
bool mixClip(int idToMove = -1, const QString &mixId = QStringLiteral("luma"), int delta = 0);
Q_INVOKABLE bool resizeStartMix(int cid, int duration, bool singleResize);
void requestResizeMix(int cid, int duration, MixAlignment align, int rightFrames = -1);
void requestResizeMix(int cid, int duration, MixAlignment align, int leftFrames = -1);
/** @brief Get Mix cut pos (the duration of the mix on the right clip) */
int getMixCutPos(int cid) const;
MixAlignment getMixAlign(int cid) const;
......
......@@ -5060,10 +5060,10 @@ int TimelineController::clipMaxDuration(int cid)
return m_model->m_allClips[cid]->getMaxDuration();
}
void TimelineController::resizeMix(int cid, int duration, MixAlignment align, int rightFrames)
void TimelineController::resizeMix(int cid, int duration, MixAlignment align, int leftFrames)
{
if (cid > -1) {
m_model->requestResizeMix(cid, duration, align, rightFrames);
m_model->requestResizeMix(cid, duration, align, leftFrames);
}
}
......
......@@ -694,7 +694,7 @@ public slots:
/** @brief Restore timeline scroll pos on open. */
void setScrollPos(int pos);
/** @brief Request resizing currently selected mix. */
void resizeMix(int cid, int duration, MixAlignment align, int rightFrames = -1);
void resizeMix(int cid, int duration, MixAlignment align, int leftFrames = -1);
/** @brief change zone info with undo. */
Q_INVOKABLE void updateZone(const QPoint oldZone, const QPoint newZone, bool withUndo = true);
Q_INVOKABLE void updateEffectZone(const QPoint oldZone, const QPoint newZone, bool withUndo = true);
......
......@@ -127,7 +127,7 @@ void MixStackView::durationChanged(const QModelIndex &, const QModelIndex &, con
QSignalBlocker bk2(m_position);
m_duration->setValue(duration + 1);
m_position->setRange(0, duration);
m_position->setPosition(mixCutPos);
m_position->setPosition(duration - mixCutPos);
checkAlignment();
}
}
......
Supports Markdown
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