Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Kdenlive
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
252
Issues
252
List
Boards
Labels
Service Desk
Milestones
Merge Requests
16
Merge Requests
16
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Multimedia
Kdenlive
Commits
0f144df5
Commit
0f144df5
authored
Sep 23, 2020
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure a mixed clip cannot be moved further than its counterpart mix clip
parent
c69bc854
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
1 deletion
+22
-1
src/timeline2/model/timelinemodel.cpp
src/timeline2/model/timelinemodel.cpp
+22
-1
No files found.
src/timeline2/model/timelinemodel.cpp
View file @
0f144df5
...
...
@@ -659,7 +659,7 @@ bool TimelineModel::requestClipMove(int clipId, int trackId, int position, bool
return
true
;
};
if
(
old_trackId
==
trackId
)
{
// We are moving a
grou
p on same track
// We are moving a
cli
p on same track
if
(
finalMove
&&
position
>=
mixData
.
first
.
firstClipInOut
.
second
)
{
int
subPlaylist
=
m_allClips
[
clipId
]
->
getSubPlaylistIndex
();
update_playlist
=
[
this
,
clipId
,
subPlaylist
]()
{
...
...
@@ -1139,6 +1139,27 @@ QVariantList TimelineModel::suggestClipMove(int clipId, int trackId, int positio
position
=
snapped
;
}
}
if
(
sourceTrackId
==
trackId
)
{
// Same track move, check if there is a mix and limit move
std
::
pair
<
MixInfo
,
MixInfo
>
mixData
=
getTrackById_const
(
trackId
)
->
getMixInfo
(
clipId
);
if
(
mixData
.
first
.
firstClipId
>
-
1
)
{
// Clip has start mix
int
clipDuration
=
m_allClips
[
clipId
]
->
getPlaytime
();
// ensure we don't move before first clip
position
=
qMax
(
position
,
mixData
.
first
.
firstClipInOut
.
first
);
if
(
position
+
clipDuration
<=
mixData
.
first
.
firstClipInOut
.
second
)
{
position
=
mixData
.
first
.
firstClipInOut
.
second
-
clipDuration
+
2
;
}
}
if
(
mixData
.
second
.
firstClipId
>
-
1
)
{
// Clip has end mix
int
clipDuration
=
m_allClips
[
clipId
]
->
getPlaytime
();
position
=
qMin
(
position
,
mixData
.
second
.
secondClipInOut
.
first
);
if
(
position
+
clipDuration
>=
mixData
.
second
.
secondClipInOut
.
second
)
{
position
=
mixData
.
second
.
secondClipInOut
.
second
-
clipDuration
-
2
;
}
}
}
// we check if move is possible
bool
possible
=
(
m_editMode
==
TimelineMode
::
NormalEdit
)
?
requestClipMove
(
clipId
,
trackId
,
position
,
moveMirrorTracks
,
true
,
false
,
false
)
:
requestFakeClipMove
(
clipId
,
trackId
,
position
,
true
,
false
,
false
);
...
...
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