From: Till Theato Date: Sat, 29 Jan 2011 22:22:50 +0000 (+0000) Subject: keyframe editor: when adding a keyframe with last keyframe selected and not at the... X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=ad7ce4d41797792d4552ad264724f29750a858d5;p=kdenlive keyframe editor: when adding a keyframe with last keyframe selected and not at the of the clip add keyframe at the end: http://kdenlive.org/mantis/view.php?id=1983 svn path=/trunk/kdenlive/; revision=5363 --- diff --git a/src/keyframeedit.cpp b/src/keyframeedit.cpp index dcad0062..fd70c71a 100644 --- a/src/keyframeedit.cpp +++ b/src/keyframeedit.cpp @@ -204,8 +204,14 @@ void KeyframeEdit::slotAddKeyframe() 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);