Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Kdenlive
Commits
a037d8c7
Commit
a037d8c7
authored
Oct 31, 2019
by
Jean-Baptiste Mardelle
Browse files
Fix resize keyframes when only 2 keyframes at in/out
parent
71823937
Pipeline
#9773
passed with stage
in 14 minutes and 15 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/assets/keyframes/model/keyframemodellist.cpp
View file @
a037d8c7
...
...
@@ -430,6 +430,21 @@ void KeyframeModelList::resizeKeyframes(int oldIn, int oldOut, int in, int out,
bool
ok3
;
Keyframe
toDel
=
getNextKeyframe
(
new_out
,
&
ok3
);
if
(
ok
&&
!
ok2
)
{
// Check if we have only 2 keyframes (in/out), in which case we move the out keyframe to new position
bool
ok4
;
kf
=
getPrevKeyframe
(
old_out
,
&
ok4
);
if
(
ok4
)
{
GenTime
current_in
(
oldIn
,
pCore
->
getCurrentFps
());
qDebug
()
<<
" = = = = = = =
\n\n
GOT 2 KF SITUATION: "
<<
current_in
.
frames
(
25
)
<<
" = "
<<
kf
.
first
.
frames
(
25
);
if
(
kf
.
first
==
current_in
)
{
// We have a 2 keyframes situation, move last one to new out
for
(
const
auto
&
param
:
m_parameters
)
{
param
.
second
->
moveKeyframe
(
old_out
,
new_out
,
QVariant
(),
undo
,
redo
);
}
return
;
}
}
positions
<<
old_out
;
}
if
(
toDel
.
first
==
GenTime
())
{
...
...
src/effects/effectstack/model/effectstackmodel.cpp
View file @
a037d8c7
...
...
@@ -581,7 +581,7 @@ bool EffectStackModel::adjustStackLength(bool adjustFromEnd, int oldIn, int oldD
std
::
shared_ptr
<
KeyframeModelList
>
keyframes
=
effect
->
getKeyframeModel
();
if
(
keyframes
!=
nullptr
)
{
// Effect has keyframes, update these
keyframes
->
resizeKeyframes
(
oldIn
,
oldIn
+
oldDuration
-
1
,
newIn
,
out
-
1
,
offset
,
adjustFromEnd
,
undo
,
redo
);
keyframes
->
resizeKeyframes
(
oldIn
,
oldIn
+
oldDuration
,
newIn
,
out
-
1
,
offset
,
adjustFromEnd
,
undo
,
redo
);
QModelIndex
index
=
getIndexFromItem
(
effect
);
Fun
refresh
=
[
effect
,
index
]()
{
effect
->
dataChanged
(
index
,
index
,
QVector
<
int
>
());
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment