Skip to content
GitLab
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
b558390f
Commit
b558390f
authored
Dec 07, 2020
by
Jean-Baptiste Mardelle
Browse files
Don't snap on subtitles when locked
parent
0fe2d82e
Changes
1
Show whitespace changes
Inline
Side-by-side
src/bin/model/subtitlemodel.cpp
View file @
b558390f
...
...
@@ -1066,6 +1066,27 @@ void SubtitleModel::switchLocked()
{
bool
isLocked
=
m_subtitleFilter
->
get_int
(
"kdenlive:locked"
)
==
1
;
m_subtitleFilter
->
set
(
"kdenlive:locked"
,
isLocked
?
0
:
1
);
// En/disable snapping on lock
std
::
vector
<
std
::
weak_ptr
<
SnapInterface
>>
validSnapModels
;
for
(
const
auto
&
snapModel
:
m_regSnaps
)
{
if
(
auto
ptr
=
snapModel
.
lock
())
{
validSnapModels
.
push_back
(
snapModel
);
if
(
isLocked
)
{
for
(
const
auto
&
subtitle
:
m_subtitleList
)
{
ptr
->
addPoint
(
subtitle
.
first
.
frames
(
pCore
->
getCurrentFps
()));
ptr
->
addPoint
(
subtitle
.
second
.
second
.
frames
(
pCore
->
getCurrentFps
()));
}
}
else
{
for
(
const
auto
&
subtitle
:
m_subtitleList
)
{
ptr
->
removePoint
(
subtitle
.
first
.
frames
(
pCore
->
getCurrentFps
()));
ptr
->
removePoint
(
subtitle
.
second
.
second
.
frames
(
pCore
->
getCurrentFps
()));
}
}
}
}
// Update the list of snapModel known to be valid
std
::
swap
(
m_regSnaps
,
validSnapModels
);
if
(
!
isLocked
)
{
// Clear selection
while
(
!
m_selected
.
isEmpty
())
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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