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

Don't allow creating keyframe outside clip after resizing

parent 38785160
Pipeline #145560 passed with stage
in 9 minutes and 3 seconds
......@@ -461,11 +461,21 @@ void KeyframeWidget::slotRefresh()
int duration = m_model->data(m_index, AssetParameterModel::ParentDurationRole).toInt(&ok);
Q_ASSERT(ok);
int in = m_model->data(m_index, AssetParameterModel::InRole).toInt(&ok);
int out = in + duration;
// m_model->dataChanged(QModelIndex(), QModelIndex());
//->getKeyframeModel()->getKeyModel(m_index)->dataChanged(QModelIndex(), QModelIndex());
m_keyframeview->setDuration(duration, in);
m_time->setRange(0, duration - 1);
m_time->setOffset(in);
int pos = m_time->getValue();
bool isInRange = pos >= in && pos < out;
connectMonitor(isInRange && m_model->isActive());
m_addDeleteAction->setEnabled(isInRange && pos > in);
int framePos = qBound(in, pos, out) - in;
if (isInRange && framePos != m_time->getValue()) {
slotSetPosition(framePos, false);
}
slotRefreshParams();
}
......
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