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
bfe47a59
Commit
bfe47a59
authored
Feb 25, 2022
by
Jean-Baptiste Mardelle
Browse files
Correctly update add/remove keyframe button on undo/redo and active keyframe on speed change
parent
6c3ad4bd
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/dialogs/timeremap.cpp
View file @
bfe47a59
...
...
@@ -311,15 +311,20 @@ void RemapView::loadKeyframes(const QString &mapData)
m_duration
=
qMax
(
m_duration
,
pos
-
m_inFrame
);
m_duration
=
qMax
(
m_duration
,
val
-
m_inFrame
);
}
bool
isKfr
=
m_keyframes
.
contains
(
m_bottomPosition
+
m_inFrame
);
if
(
isKfr
)
{
bool
isLast
=
m_bottomPosition
+
m_inFrame
==
m_keyframes
.
firstKey
()
||
m_bottomPosition
+
m_inFrame
==
m_keyframes
.
lastKey
();
emit
atKeyframe
(
isKfr
,
isLast
);
}
else
{
emit
atKeyframe
(
false
,
false
);
}
if
(
m_keyframes
.
contains
(
m_currentKeyframe
.
first
))
{
bool
isLast
=
m_currentKeyframe
.
first
==
m_keyframes
.
firstKey
()
||
m_currentKeyframe
.
first
==
m_keyframes
.
lastKey
();
emit
atKeyframe
(
true
,
isLast
);
//
bool isLast = m_currentKeyframe.first == m_keyframes.firstKey() || m_currentKeyframe.first == m_keyframes.lastKey();
//
emit atKeyframe(true, isLast);
std
::
pair
<
double
,
double
>
speeds
=
getSpeed
(
m_currentKeyframe
);
std
::
pair
<
bool
,
bool
>
atEnd
=
{
m_currentKeyframe
.
first
==
m_inFrame
,
m_currentKeyframe
.
first
==
m_keyframes
.
lastKey
()};
emit
selectedKf
(
m_currentKeyframe
,
speeds
,
atEnd
);
}
else
{
emit
atKeyframe
(
false
,
false
);
m_currentKeyframe
=
{
-
1
,
-
1
};
emit
selectedKf
(
m_currentKeyframe
,
{
-
1
,
-
1
}
);
}
...
...
@@ -1997,6 +2002,7 @@ void TimeRemap::updateKeyframesWithUndo(const QMap<int,int> &updatedKeyframes, c
}
return
true
;
};
local_redo
();
if
(
durationChanged
)
{
int
length
=
updatedKeyframes
.
lastKey
()
-
m_view
->
m_inFrame
+
1
;
std
::
shared_ptr
<
TimelineItemModel
>
model
=
pCore
->
window
()
->
getCurrentTimeline
()
->
controller
()
->
getModel
();
...
...
@@ -2005,7 +2011,6 @@ void TimeRemap::updateKeyframesWithUndo(const QMap<int,int> &updatedKeyframes, c
model
->
requestItemResize
(
m_splitId
,
length
,
true
,
true
,
undo
,
redo
);
}
}
local_redo
();
UPDATE_UNDO_REDO_NOLOCK
(
redo
,
undo
,
local_undo
,
local_redo
);
pCore
->
pushUndo
(
local_undo
,
local_redo
,
i18n
(
"Edit Timeremap keyframes"
));
}
...
...
Write
Preview
Markdown
is supported
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