Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLMC
Manage
Activity
Members
Labels
Plan
Issues
26
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLMC
Commits
85c26318
Commit
85c26318
authored
8 years ago
by
luyikei
Browse files
Options
Downloads
Patches
Plain Diff
Track.qml: Fix some errors and strange behavior on locating clips
parent
9f7ef136
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Gui/timeline/Track.qml
+21
-18
21 additions, 18 deletions
src/Gui/timeline/Track.qml
with
21 additions
and
18 deletions
src/Gui/timeline/Track.qml
+
21
−
18
View file @
85c26318
...
...
@@ -77,7 +77,7 @@ Item {
if
(
currentTrack
)
var
clips
=
currentTrack
[
"
clips
"
];
else
currentTrack
.
append
(
{
"
clips
"
:
[]
}
)
;
return
oldX
;
for
(
j
=
0
;
j
<
clips
.
count
+
2
&&
isCollided
;
++
j
)
{
isCollided
=
false
;
for
(
k
=
0
;
k
<
clips
.
count
;
++
k
)
{
...
...
@@ -239,14 +239,17 @@ Item {
scrollToTarget
(
drag
.
source
);
// Optimization: Delta delta X should be 0
if
(
ptof
(
deltaX
)
===
ptof
(
drag
.
source
.
x
-
lastX
)
&&
drag
.
source
.
x
!==
0
)
{
lastX
=
drag
.
source
.
x
;
return
;
if
(
drag
.
source
.
x
!==
findNewPosition
(
drag
.
source
.
x
,
drag
.
source
,
false
)
)
deltaX
=
0
;
else
{
// Optimization: Delta delta X should be 0
if
(
ptof
(
deltaX
)
===
ptof
(
drag
.
source
.
x
-
lastX
)
&&
drag
.
source
.
x
!==
0
)
{
lastX
=
drag
.
source
.
x
;
return
;
}
else
deltaX
=
drag
.
source
.
x
-
lastX
;
}
else
deltaX
=
drag
.
source
.
x
-
lastX
;
}
else
deltaX
=
drag
.
x
-
lastX
;
...
...
@@ -259,7 +262,7 @@ Item {
target
.
newTrackId
=
trackId
;
for
(
var
j
=
0
;
j
<
selectedClips
.
length
;
++
j
)
{
if
(
drag
.
source
!==
selectedClips
[
j
]
)
selectedClips
[
j
].
newTrackId
=
trackId
-
oldTrackId
+
selectedClips
[
j
].
trackId
;
selectedClips
[
j
].
newTrackId
=
Math
.
max
(
0
,
trackId
-
oldTrackId
+
selectedClips
[
j
].
trackId
)
;
}
}
...
...
@@ -267,15 +270,6 @@ Item {
var
oldX
=
target
.
pixelPosition
();
var
newX
=
Math
.
max
(
oldX
+
deltaX
,
0
);
// Recalculate deltaX in case of drag.source being moved
if
(
drag
.
source
===
target
)
{
if
(
oldTrackId
===
target
.
newTrackId
)
deltaX
=
Math
.
round
(
newX
-
oldX
);
else
// Don't move other clips if drag.source's track is changed
deltaX
=
0
;
}
newX
=
findNewPosition
(
newX
,
target
,
isMagneticMode
);
// Let's find newX of the linked clip
...
...
@@ -311,6 +305,15 @@ Item {
length
=
ptof
(
newX
+
target
.
width
);
}
// Recalculate deltaX in case of drag.source being moved
if
(
drag
.
source
===
target
)
{
if
(
oldTrackId
===
target
.
newTrackId
)
deltaX
=
newX
-
oldX
;
else
// Don't move other clips if drag.source's track is changed
deltaX
=
0
;
}
target
.
setPixelPosition
(
newX
);
alreadyCalculated
.
push
(
target
.
uuid
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment