]> git.sesse.net Git - kdenlive/commitdiff
keyframe editor: when adding a keyframe with last keyframe selected and not at the...
authorTill Theato <root@ttill.de>
Sat, 29 Jan 2011 22:22:50 +0000 (22:22 +0000)
committerTill Theato <root@ttill.de>
Sat, 29 Jan 2011 22:22:50 +0000 (22:22 +0000)
http://kdenlive.org/mantis/view.php?id=1983

svn path=/trunk/kdenlive/; revision=5363

src/keyframeedit.cpp

index dcad006285114878c51a81f2fea1a5a433a8cb46..fd70c71aa110d924271994363a1de59d366344d0 100644 (file)
@@ -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);