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
a8f474c5
Commit
a8f474c5
authored
Jan 08, 2020
by
Jean-Baptiste Mardelle
Browse files
Shift + double click to add a new point to rotoscoping
Related to
#123
parent
b8e722b4
Pipeline
#12962
passed with stage
in 17 minutes and 21 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/monitor/view/kdenlivemonitorrotoscene.qml
View file @
a8f474c5
...
...
@@ -240,6 +240,45 @@ Item {
hoverEnabled
:
true
cursorShape
:
!
root
.
isDefined
?
Qt
.
PointingHandCursor
:
(
pointContainsMouse
||
centerContainsMouse
)
?
Qt
.
PointingHandCursor
:
Qt
.
ArrowCursor
onDoubleClicked
:
{
if
(
!
root
.
isDefined
)
{
return
}
if
(
mouse
.
modifiers
&
Qt
.
ShiftModifier
)
{
var
p0
;
var
p1
;
var
p2
;
var
dab
;
var
dap
;
var
dbp
;
var
newPoint
=
Qt
.
point
((
mouseX
-
frame
.
x
)
/
root
.
scalex
,
(
mouseY
-
frame
.
y
)
/
root
.
scaley
);
for
(
var
i
=
0
;
i
<
root
.
centerPoints
.
length
;
i
++
)
{
p1
=
root
.
centerPoints
[
i
]
if
(
i
==
0
)
{
p0
=
root
.
centerPoints
[
root
.
centerPoints
.
length
-
1
]
}
else
{
p0
=
root
.
centerPoints
[
i
-
1
]
}
dab
=
Math
.
sqrt
(
Math
.
pow
(
p1
.
x
-
p0
.
x
,
2
)
+
Math
.
pow
(
p1
.
y
-
p0
.
y
,
2
))
dap
=
Math
.
sqrt
(
Math
.
pow
(
newPoint
.
x
-
p0
.
x
,
2
)
+
Math
.
pow
(
newPoint
.
y
-
p0
.
y
,
2
))
dbp
=
Math
.
sqrt
(
Math
.
pow
(
p1
.
x
-
newPoint
.
x
,
2
)
+
Math
.
pow
(
p1
.
y
-
newPoint
.
y
,
2
))
if
(
Math
.
abs
(
dab
-
dap
-
dbp
)
<
8
)
{
var
ctrl1
=
Qt
.
point
((
p0
.
x
-
newPoint
.
x
)
/
5
,
(
p0
.
y
-
newPoint
.
y
)
/
5
);
var
ctrl2
=
Qt
.
point
((
p1
.
x
-
newPoint
.
x
)
/
5
,
(
p1
.
y
-
newPoint
.
y
)
/
5
);
if
(
i
==
0
)
{
root
.
centerPoints
.
push
(
newPoint
)
root
.
centerPointsTypes
.
push
(
Qt
.
point
(
newPoint
.
x
+
ctrl1
.
x
,
newPoint
.
y
+
ctrl1
.
y
))
root
.
centerPointsTypes
.
push
(
Qt
.
point
(
newPoint
.
x
+
ctrl2
.
x
,
newPoint
.
y
+
ctrl2
.
y
))
}
else
{
root
.
centerPoints
.
splice
(
i
,
0
,
newPoint
)
root
.
centerPointsTypes
.
splice
(
2
*
i
,
0
,
Qt
.
point
(
newPoint
.
x
+
ctrl2
.
x
,
newPoint
.
y
+
ctrl2
.
y
))
root
.
centerPointsTypes
.
splice
(
2
*
i
,
0
,
Qt
.
point
(
newPoint
.
x
+
ctrl1
.
x
,
newPoint
.
y
+
ctrl1
.
y
))
}
root
.
effectPolygonChanged
()
canvas
.
requestPaint
()
break
}
}
}
else
{
root
.
addKeyframe
()
}
}
onClicked
:
{
if
(
!
root
.
isDefined
)
{
if
(
mouse
.
button
==
Qt
.
RightButton
&&
root
.
centerPoints
.
length
>
2
)
{
...
...
@@ -273,10 +312,6 @@ Item {
}
}
onDoubleClicked
:
{
root
.
addKeyframe
()
}
onPositionChanged
:
{
if
(
root
.
iskeyframe
==
false
)
return
;
if
(
pressed
)
{
...
...
Farid Abdelnour
🎥
@frdbr
mentioned in issue
#123
·
Jan 08, 2020
mentioned in issue
#123
mentioned in issue #123
Toggle commit list
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