result = m_min;
}
} else {
- int pos2 = getPos(row - 1);
- result = pos2 + (pos1 - pos2) / 2;
+ if (pos1 < m_max - 1) {
+ // last keyframe selected and it is not at end of clip -> add keyframe at the end
+ result = m_max - 1;
+ newrow++;
+ } else {
+ int pos2 = getPos(row - 1);
+ result = pos2 + (pos1 - pos2) / 2;
+ }
}
keyframe_list->insertRow(newrow);
continue;
int val = doubleparam->getValue();
QTableWidgetItem *nitem = keyframe_list->item(item->row(), col);
- if (nitem->text().toInt() != val)
+ if (nitem && nitem->text().toInt() != val)
nitem->setText(QString::number(val));
}
//keyframe_list->item(item->row() - 1, item->column());
return;
}
- slotUpdateVisibleParameter(0, false);
- QRadioButton *radio = static_cast<QRadioButton*>(m_slidersLayout->itemAtPosition(0, 1)->widget());
+ slotUpdateVisibleParameter(0);
+ QRadioButton *radio = static_cast<QRadioButton*>(m_slidersLayout->itemAtPosition(0, 1)->layout()->itemAt(0)->widget());
if (radio)
radio->setChecked(true);
}