Commit 9c441054 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle

Merge branch '2008'

parents 8f29a8fc 63ca93a4
Pipeline #28802 passed with stage
in 15 minutes and 43 seconds
......@@ -38,7 +38,7 @@ KeyframeMonitorHelper::KeyframeMonitorHelper(Monitor *monitor, std::shared_ptr<A
bool KeyframeMonitorHelper::connectMonitor(bool activate)
{
if (activate == m_active) {
return false;
return true;
}
m_active = activate;
if (activate) {
......
......@@ -114,13 +114,13 @@ void KeyframeView::slotAddKeyframe(int pos)
void KeyframeView::slotAddRemove()
{
emit activateEffect();
int offset = pCore->getItemIn(m_model->getOwnerId());
if (m_model->hasKeyframe(m_position + offset)) {
slotRemoveKeyframe(m_position);
} else {
slotAddKeyframe(m_position);
}
emit activateEffect();
}
void KeyframeView::slotEditType(int type, const QPersistentModelIndex &index)
......@@ -150,6 +150,7 @@ void KeyframeView::setDuration(int dur)
void KeyframeView::slotGoToNext()
{
emit activateEffect();
if (m_position == m_duration - 1) {
return;
}
......@@ -164,11 +165,11 @@ void KeyframeView::slotGoToNext()
// no keyframe after current position
emit seekToPos(m_duration - 1);
}
emit activateEffect();
}
void KeyframeView::slotGoToPrev()
{
emit activateEffect();
if (m_position == 0) {
return;
}
......@@ -183,7 +184,6 @@ void KeyframeView::slotGoToPrev()
// no keyframe after current position
emit seekToPos(m_duration - 1);
}
emit activateEffect();
}
void KeyframeView::mousePressEvent(QMouseEvent *event)
......
......@@ -52,6 +52,7 @@ KeyframeWidget::KeyframeWidget(std::shared_ptr<AssetParameterModel> model, QMode
, m_sourceFrameSize(frameSize.isValid() && !frameSize.isNull() ? frameSize : pCore->getCurrentFrameSize())
, m_baseHeight(0)
, m_addedHeight(0)
, m_effectIsSelected(false)
{
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
m_lay = new QVBoxLayout(this);
......@@ -243,7 +244,7 @@ void KeyframeWidget::slotRefreshParams()
((GeometryWidget *)w.second)->setValue(rect, opacity);
}
}
if (m_monitorHelper) {
if (m_monitorHelper && m_effectIsSelected) {
m_monitorHelper->refreshParams(pos);
return;
}
......@@ -407,6 +408,7 @@ void KeyframeWidget::addParameter(const QPersistentModelIndex &index)
void KeyframeWidget::slotInitMonitor(bool active)
{
Monitor *monitor = pCore->getMonitor(m_model->monitorId);
m_effectIsSelected = active;
if (m_keyframeview) {
m_keyframeview->initKeyframePos();
connect(monitor, &Monitor::updateScene, m_keyframeview, &KeyframeView::slotModelChanged, Qt::UniqueConnection);
......@@ -417,7 +419,7 @@ void KeyframeWidget::slotInitMonitor(bool active)
void KeyframeWidget::connectMonitor(bool active)
{
if (m_monitorHelper) {
if (m_monitorHelper->connectMonitor(active)) {
if (m_monitorHelper->connectMonitor(active) && m_effectIsSelected) {
slotRefreshParams();
}
}
......
......@@ -100,6 +100,7 @@ private:
std::unordered_map<QPersistentModelIndex, QWidget *> m_parameters;
int m_baseHeight;
int m_addedHeight;
bool m_effectIsSelected;
signals:
void addIndex(QPersistentModelIndex ix);
......
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