Skip to content
GitLab
Menu
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
8580bf21
Commit
8580bf21
authored
Apr 23, 2019
by
Nicolas Carion
Browse files
fix razor tool not working in some cases. Fixes
#160
parent
7b2afc26
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/timeline2/view/qml/timeline.qml
View file @
8580bf21
...
...
@@ -855,6 +855,11 @@ Rectangle {
rubberSelect
.
width
=
0
rubberSelect
.
height
=
0
}
else
if
(
mouse
.
button
&
Qt
.
LeftButton
)
{
if
(
root
.
activeTool
===
1
)
{
// razor tool
var
y
=
mouse
.
y
-
ruler
.
height
+
scrollView
.
flickableItem
.
contentY
timeline
.
cutClipUnderCursor
((
scrollView
.
flickableItem
.
contentX
+
mouse
.
x
)
/
timeline
.
scaleFactor
,
tracksRepeater
.
itemAt
(
Logic
.
getTrackIndexFromPos
(
y
)).
trackInternalId
)
}
if
(
dragProxy
.
draggedItem
>
-
1
)
{
mouse
.
accepted
=
false
return
...
...
@@ -878,10 +883,6 @@ Rectangle {
}
timeline
.
seekPosition
=
Math
.
min
((
scrollView
.
flickableItem
.
contentX
+
mouse
.
x
)
/
timeline
.
scaleFactor
,
timeline
.
fullDuration
-
1
)
timeline
.
position
=
timeline
.
seekPosition
}
else
if
(
root
.
activeTool
===
1
)
{
// razor tool
var
y
=
mouse
.
y
-
ruler
.
height
+
scrollView
.
flickableItem
.
contentY
timeline
.
cutClipUnderCursor
((
scrollView
.
flickableItem
.
contentX
+
mouse
.
x
)
/
timeline
.
scaleFactor
,
tracksRepeater
.
itemAt
(
Logic
.
getTrackIndexFromPos
(
y
)).
trackInternalId
)
}
}
else
if
(
mouse
.
button
&
Qt
.
RightButton
)
{
menu
.
clickedX
=
mouse
.
x
...
...
@@ -909,6 +910,12 @@ Rectangle {
clickY
=
mouseY
return
}
if
(
!
pressed
&&
!
rubberSelect
.
visible
&&
root
.
activeTool
===
1
)
{
cutLine
.
x
=
Math
.
floor
((
scrollView
.
flickableItem
.
contentX
+
mouse
.
x
)
/
timeline
.
scaleFactor
)
*
timeline
.
scaleFactor
-
scrollView
.
flickableItem
.
contentX
if
(
mouse
.
modifiers
&
Qt
.
ShiftModifier
)
{
timeline
.
position
=
Math
.
floor
((
scrollView
.
flickableItem
.
contentX
+
mouse
.
x
)
/
timeline
.
scaleFactor
)
}
}
if
(
dragProxy
.
draggedItem
>
-
1
)
{
mouse
.
accepted
=
false
return
...
...
@@ -951,12 +958,6 @@ Rectangle {
scim
=
true
}
else
{
scim
=
false
if
(
root
.
activeTool
===
1
)
{
cutLine
.
x
=
Math
.
floor
((
scrollView
.
flickableItem
.
contentX
+
mouse
.
x
)
/
timeline
.
scaleFactor
)
*
timeline
.
scaleFactor
-
scrollView
.
flickableItem
.
contentX
if
(
mouse
.
modifiers
&
Qt
.
ShiftModifier
)
{
timeline
.
position
=
Math
.
floor
((
scrollView
.
flickableItem
.
contentX
+
mouse
.
x
)
/
timeline
.
scaleFactor
)
}
}
}
}
onReleased
:
{
...
...
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