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

Merge branch '2112'

parents bb80dff2 a43533d3
Pipeline #102056 passed with stage
in 8 minutes and 36 seconds
......@@ -117,13 +117,13 @@ void KeyframeView::slotDuplicateKeyframe()
}
}
void KeyframeView::slotAddKeyframe(int pos)
bool KeyframeView::slotAddKeyframe(int pos)
{
if (pos < 0) {
pos = m_position;
}
int offset = pCore->getItemIn(m_model->getOwnerId());
m_model->addKeyframe(GenTime(pos + offset, pCore->getCurrentFps()), KeyframeType(KdenliveSettings::defaultkeyframeinterp()));
return m_model->addKeyframe(GenTime(pos + offset, pCore->getCurrentFps()), KeyframeType(KdenliveSettings::defaultkeyframeinterp()));
}
const QString KeyframeView::getAssetId()
......@@ -143,7 +143,14 @@ void KeyframeView::slotAddRemove()
slotRemoveKeyframe({m_position});
}
} else {
slotAddKeyframe(m_position);
if (slotAddKeyframe(m_position)) {
int offset = pCore->getItemIn(m_model->getOwnerId());
GenTime position(m_position + offset, pCore->getCurrentFps());
int currentIx = m_model->getIndexForPos(position);
if (currentIx > -1) {
m_model->setSelectedKeyframes({currentIx});
}
}
}
}
......
......@@ -35,7 +35,7 @@ public slots:
/** @brief Add a keyframe with given parameter value at given pos.
If pos is negative, then keyframe is added at current position
*/
void slotAddKeyframe(int pos = -1);
bool slotAddKeyframe(int pos = -1);
/** @brief Duplicate selected keyframe at cursor position
*/
void slotDuplicateKeyframe();
......
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