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
258
Issues
258
List
Boards
Labels
Service Desk
Milestones
Merge Requests
15
Merge Requests
15
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
60c3a4dc
Commit
60c3a4dc
authored
Aug 13, 2019
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix timeline drag in overwrite/edit mode
parent
8f21a725
Pipeline
#6570
passed with stage
in 18 minutes and 2 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
5 deletions
+17
-5
src/timeline2/model/timelinemodel.cpp
src/timeline2/model/timelinemodel.cpp
+4
-3
src/timeline2/view/qml/timeline.qml
src/timeline2/view/qml/timeline.qml
+1
-1
src/timeline2/view/timelinecontroller.cpp
src/timeline2/view/timelinecontroller.cpp
+12
-1
No files found.
src/timeline2/model/timelinemodel.cpp
View file @
60c3a4dc
...
...
@@ -606,8 +606,9 @@ bool TimelineModel::requestFakeClipMove(int clipId, int trackId, int position, b
QWriteLocker
locker
(
&
m_lock
);
TRACE
(
clipId
,
trackId
,
position
,
updateView
,
logUndo
,
invalidateTimeline
)
Q_ASSERT
(
m_allClips
.
count
(
clipId
)
>
0
);
if
(
m_allClips
[
clipId
]
->
getPosition
()
==
position
&&
getClipTrackId
(
clipId
)
==
trackId
)
{
if
(
m_allClips
[
clipId
]
->
getPosition
()
==
position
&&
m_allClips
[
clipId
]
->
getFakeTrackId
(
)
==
trackId
)
{
TRACE_RES
(
true
);
qDebug
()
<<
"........
\n
ABORTING MOVE; SAME POS/TRACK
\n
.........."
;
return
true
;
}
if
(
m_groups
->
isInGroup
(
clipId
))
{
...
...
@@ -709,7 +710,7 @@ int TimelineModel::suggestClipMove(int clipId, int trackId, int position, int cu
// Trying move on incompatible track type, stay on same track
trackId
=
sourceTrackId
;
}
if
(
currentPos
==
position
&&
sourceTrackId
==
trackId
)
{
if
(
currentPos
==
position
&&
m_editMode
==
TimelineMode
::
NormalEdit
&&
sourceTrackId
==
trackId
)
{
TRACE_RES
(
position
);
return
position
;
}
...
...
@@ -739,7 +740,7 @@ int TimelineModel::suggestClipMove(int clipId, int trackId, int position, int cu
}
}
// we check if move is possible
bool
possible
=
m_editMode
==
TimelineMode
::
NormalEdit
?
requestClipMove
(
clipId
,
trackId
,
position
,
moveMirrorTracks
,
true
,
false
,
false
)
bool
possible
=
(
m_editMode
==
TimelineMode
::
NormalEdit
)
?
requestClipMove
(
clipId
,
trackId
,
position
,
moveMirrorTracks
,
true
,
false
,
false
)
:
requestFakeClipMove
(
clipId
,
trackId
,
position
,
true
,
false
,
false
);
/*} else {
possible = requestClipMoveAttempt(clipId, trackId, position);
...
...
src/timeline2/view/qml/timeline.qml
View file @
60c3a4dc
...
...
@@ -1201,7 +1201,7 @@ Rectangle {
var
posy
=
Math
.
min
(
Math
.
max
(
0
,
mouse
.
y
+
parent
.
y
-
dragProxy
.
verticalOffset
),
tracksContainerArea
.
height
)
var
tId
=
Logic
.
getTrackIdFromPos
(
posy
)
if
(
dragProxy
.
masterObject
&&
tId
==
dragProxy
.
masterObject
.
trackId
)
{
if
(
posx
==
dragFrame
)
{
if
(
posx
==
dragFrame
&&
controller
.
normalEdit
()
)
{
return
}
}
...
...
src/timeline2/view/timelinecontroller.cpp
View file @
60c3a4dc
...
...
@@ -2239,7 +2239,10 @@ void TimelineController::grabCurrent()
int
TimelineController
::
getItemMovingTrack
(
int
itemId
)
const
{
if
(
m_model
->
isClip
(
itemId
))
{
int
trackId
=
m_model
->
m_allClips
[
itemId
]
->
getFakeTrackId
();
int
trackId
=
-
1
;
if
(
m_model
->
m_editMode
!=
TimelineMode
::
NormalEdit
)
{
trackId
=
m_model
->
m_allClips
[
itemId
]
->
getFakeTrackId
();
}
return
trackId
<
0
?
m_model
->
m_allClips
[
itemId
]
->
getCurrentTrackId
()
:
trackId
;
}
return
m_model
->
m_allCompositions
[
itemId
]
->
getCurrentTrackId
();
...
...
@@ -2284,6 +2287,10 @@ bool TimelineController::endFakeMove(int clipId, int position, bool updateView,
}
res
=
res
&&
m_model
->
getTrackById
(
trackId
)
->
requestClipInsertion
(
clipId
,
position
,
updateView
,
invalidateTimeline
,
undo
,
redo
);
if
(
res
)
{
// Terminate fake move
if
(
m_model
->
isClip
(
clipId
))
{
m_model
->
m_allClips
[
clipId
]
->
setFakeTrackId
(
-
1
);
}
if
(
logUndo
)
{
pCore
->
pushUndo
(
undo
,
redo
,
i18n
(
"Move item"
));
}
...
...
@@ -2300,6 +2307,10 @@ bool TimelineController::endFakeGroupMove(int clipId, int groupId, int delta_tra
std
::
function
<
bool
(
void
)
>
redo
=
[]()
{
return
true
;
};
bool
res
=
endFakeGroupMove
(
clipId
,
groupId
,
delta_track
,
delta_pos
,
updateView
,
logUndo
,
undo
,
redo
);
if
(
res
&&
logUndo
)
{
// Terminate fake move
if
(
m_model
->
isClip
(
clipId
))
{
m_model
->
m_allClips
[
clipId
]
->
setFakeTrackId
(
-
1
);
}
pCore
->
pushUndo
(
undo
,
redo
,
i18n
(
"Move group"
));
}
return
res
;
...
...
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