Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Kdenlive
Commits
300b03ac
Commit
300b03ac
authored
May 31, 2020
by
Jean-Baptiste Mardelle
Browse files
Make effect keyframe view follow cursor when zoomed
parent
2a792bfe
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/assets/keyframes/view/keyframeview.cpp
View file @
300b03ac
...
@@ -82,6 +82,18 @@ void KeyframeView::slotSetPosition(int pos, bool isInRange)
...
@@ -82,6 +82,18 @@ void KeyframeView::slotSetPosition(int pos, bool isInRange)
m_position
=
pos
;
m_position
=
pos
;
int
offset
=
pCore
->
getItemIn
(
m_model
->
getOwnerId
());
int
offset
=
pCore
->
getItemIn
(
m_model
->
getOwnerId
());
emit
atKeyframe
(
m_model
->
hasKeyframe
(
pos
+
offset
),
m_model
->
singleKeyframe
());
emit
atKeyframe
(
m_model
->
hasKeyframe
(
pos
+
offset
),
m_model
->
singleKeyframe
());
double
zoomPos
=
(
double
)
m_position
/
m_duration
;
if
(
zoomPos
<
m_zoomHandle
.
x
())
{
double
interval
=
m_zoomHandle
.
y
()
-
m_zoomHandle
.
x
();
zoomPos
=
qBound
(
0.0
,
zoomPos
-
interval
/
5
,
1.0
);
m_zoomHandle
.
setX
(
zoomPos
);
m_zoomHandle
.
setY
(
zoomPos
+
interval
);
}
else
if
(
zoomPos
>
m_zoomHandle
.
y
())
{
double
interval
=
m_zoomHandle
.
y
()
-
m_zoomHandle
.
x
();
zoomPos
=
qBound
(
0.0
,
zoomPos
+
interval
/
5
,
1.0
);
m_zoomHandle
.
setX
(
zoomPos
-
interval
);
m_zoomHandle
.
setY
(
zoomPos
);
}
update
();
update
();
}
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment