Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
luyikei
VLMC
Commits
f9fcbd05
Commit
f9fcbd05
authored
Jul 29, 2017
by
luyikei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Track.qml: Fix some unstable move
Sorry for those mistakes...
parent
692be057
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
7 deletions
+12
-7
src/Gui/timeline/Track.qml
src/Gui/timeline/Track.qml
+10
-5
src/Gui/timeline/main.qml
src/Gui/timeline/main.qml
+2
-2
No files found.
src/Gui/timeline/Track.qml
View file @
f9fcbd05
...
...
@@ -114,6 +114,7 @@ Item {
// HACK: Call onPositoinChanged forcely here.
// x will be rounded so it won't affect actual its position.
drag
.
source
.
x
=
drag
.
source
.
x
+
0.000001
;
drag
.
source
.
forcePosition
();
// Restore the binding
}
}
...
...
@@ -127,6 +128,10 @@ Item {
else
dMode
=
dropMode
.
Move
;
// Scroll to the drag source
if
(
dMode
===
dropMode
.
Move
)
drag
.
source
.
scrollToThis
();
sortSelectedClips
();
var
toMove
=
selectedClips
.
concat
();
...
...
@@ -146,7 +151,7 @@ Item {
if
(
newTrackId
<
0
)
{
drag
.
source
.
newTrackId
=
oldTrackId
;
drag
.
source
.
setPixelPosition
(
drag
.
source
.
pixel
Position
()
)
;
drag
.
source
.
force
Position
();
// Direction depends on its type
drag
.
source
.
y
+=
...
...
@@ -204,13 +209,13 @@ Item {
if
(
newLinkedClipPos
!==
newPos
)
deltaPos
=
0
else
deltaPos
=
newPos
-
oldPos
;
linkedClipItem
.
position
=
target
.
position
;
// Link if possible
}
else
deltaPos
=
0
;
}
else
deltaPos
=
newPos
-
oldPos
;
linkedClipItem
.
position
=
target
.
position
;
// Link if possible
var
ind
=
toMove
.
indexOf
(
linkedClipItem
.
uuid
);
if
(
ind
>
0
)
...
...
@@ -232,7 +237,7 @@ Item {
target
=
findClipItem
(
selectedClips
[
i
]
);
newPos
=
target
.
position
+
deltaPos
;
// We only want to update the length when the
lef
t edge of the timeline
// We only want to update the length when the
righ
t edge of the timeline
// is exposed.
if
(
sView
.
flickableItem
.
contentX
+
page
.
width
>
sView
.
width
&&
length
<
newPos
+
target
.
length
)
{
...
...
@@ -247,7 +252,7 @@ Item {
}
if
(
dMode
===
dropMode
.
Move
)
lastPos
=
ptof
(
drag
.
source
.
x
)
;
lastPos
=
drag
.
source
.
position
;
else
lastPos
=
ptof
(
drag
.
x
);
}
...
...
src/Gui/timeline/main.qml
View file @
f9fcbd05
...
...
@@ -76,8 +76,8 @@ Rectangle {
// but not if "clip" is also selected because both of them will be moving
// and we want to keep the same distance between them as much as possible
var
clipMargin
=
useMagneticMode
&&
findClipItem
(
clip
.
uuid
).
selected
===
false
?
ptof
(
magneticMargin
)
:
0
;
cPos
+
=
clipMargin
*
2
;
cEndPos
-
=
clipMargin
;
cPos
-
=
clipMargin
;
cEndPos
+
=
clipMargin
;
if
(
cEndPos
>=
newPos
&&
newPos
+
target
.
length
-
1
>=
cPos
)
{
if
(
cPos
>=
newPos
)
{
if
(
cPos
-
target
.
length
+
1
>
0
)
...
...
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