Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
VideoLAN
VLMC
Commits
9f7ef136
Commit
9f7ef136
authored
Jul 28, 2016
by
luyikei
Browse files
Track.qml: Compare positions using frames instead of pixels
parent
3ac5cbd2
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Gui/timeline/Track.qml
View file @
9f7ef136
...
...
@@ -239,8 +239,8 @@ Item {
scrollToTarget
(
drag
.
source
);
// Optimization: Delta delta X should be
different
if
(
deltaX
===
drag
.
source
.
x
-
lastX
&&
drag
.
source
.
x
!==
0
)
{
// Optimization: Delta delta X should be
0
if
(
ptof
(
deltaX
)
===
ptof
(
drag
.
source
.
x
-
lastX
)
&&
drag
.
source
.
x
!==
0
)
{
lastX
=
drag
.
source
.
x
;
return
;
}
...
...
@@ -286,7 +286,7 @@ Item {
var
newLinkedClipX
=
findNewPosition
(
newX
,
linkedClipItem
,
isMagneticMode
);
// If linked clip collides
if
(
Math
.
abs
(
newLinkedClipX
-
newX
)
>
1
)
{
if
(
ptof
(
Math
.
abs
(
newLinkedClipX
-
newX
)
)
!==
0
)
{
// Recalculate target's newX
// This time, don't use magnets
...
...
@@ -294,7 +294,7 @@ Item {
newLinkedClipX
=
findNewPosition
(
newX
,
target
,
false
);
// And if newX collides again, we don't move
if
(
Math
.
abs
(
newLinkedClipX
-
newX
)
>
1
)
if
(
ptof
(
Math
.
abs
(
newLinkedClipX
-
newX
)
)
!==
0
)
newX
=
oldX
;
}
...
...
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