Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Kdenlive
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
258
Issues
258
List
Boards
Labels
Service Desk
Milestones
Merge Requests
15
Merge Requests
15
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Multimedia
Kdenlive
Commits
60a1ba38
Commit
60a1ba38
authored
Aug 27, 2019
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ctrl resize in monitor effects keeps center position
Fixes
#321
parent
0e18e35c
Pipeline
#7071
passed with stage
in 18 minutes and 52 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
21 deletions
+49
-21
src/monitor/view/kdenlivemonitoreffectscene.qml
src/monitor/view/kdenlivemonitoreffectscene.qml
+49
-21
No files found.
src/monitor/view/kdenlivemonitoreffectscene.qml
View file @
60a1ba38
...
...
@@ -257,21 +257,25 @@ Item {
}
onPositionChanged
:
{
if
(
pressed
)
{
adjustedFrame
=
framesize
if
(
root
.
lockratio
>
0
||
mouse
.
modifiers
&
Qt
.
ShiftModifier
)
{
var
delta
=
Math
.
max
(
mouseX
-
oldMouseX
,
mouseY
-
oldMouseY
)
var
newwidth
=
framerect
.
width
-
delta
adjustedFrame
=
framesize
adjustedFrame
.
width
=
Math
.
round
(
newwidth
/
root
.
scalex
);
adjustedFrame
.
height
=
Math
.
round
(
adjustedFrame
.
width
/
(
root
.
lockratio
>
0
?
root
.
lockratio
:
handleRatio
))
adjustedFrame
.
y
=
(
framerect
.
y
-
frame
.
y
)
/
root
.
scaley
+
framesize
.
height
-
adjustedFrame
.
height
;
adjustedFrame
.
x
=
(
framerect
.
x
-
frame
.
x
)
/
root
.
scalex
+
framesize
.
width
-
adjustedFrame
.
width
;
framesize
=
adjustedFrame
}
else
{
framesiz
e
.
x
=
(
framerect
.
x
+
(
mouseX
-
oldMouseX
)
-
frame
.
x
)
/
root
.
scalex
;
framesize
.
width
=
(
framerect
.
width
-
(
mouseX
-
oldMouseX
))
/
root
.
scalex
;
framesize
.
y
=
(
framerect
.
y
+
(
mouseY
-
oldMouseY
)
-
frame
.
y
)
/
root
.
scaley
;
framesiz
e
.
height
=
(
framerect
.
height
-
(
mouseY
-
oldMouseY
))
/
root
.
scaley
;
adjustedFram
e
.
x
=
(
framerect
.
x
+
(
mouseX
-
oldMouseX
)
-
frame
.
x
)
/
root
.
scalex
;
adjustedFrame
.
y
=
(
framerect
.
y
+
(
mouseY
-
oldMouseY
)
-
frame
.
y
)
/
root
.
scaley
;
adjustedFrame
.
width
=
(
framerect
.
width
-
(
mouseX
-
oldMouseX
))
/
root
.
scalex
;
adjustedFram
e
.
height
=
(
framerect
.
height
-
(
mouseY
-
oldMouseY
))
/
root
.
scaley
;
}
if
(
mouse
.
modifiers
&
Qt
.
ControlModifier
)
{
adjustedFrame
.
width
-=
(
framesize
.
width
-
adjustedFrame
.
width
)
adjustedFrame
.
height
-=
(
framesize
.
height
-
adjustedFrame
.
height
)
}
framesize
=
adjustedFrame
root
.
effectChanged
()
}
}
...
...
@@ -330,19 +334,25 @@ Item {
}
onPositionChanged
:
{
if
(
pressed
)
{
adjustedFrame
=
framesize
if
(
root
.
lockratio
>
0
||
mouse
.
modifiers
&
Qt
.
ShiftModifier
)
{
var
delta
=
Math
.
max
(
oldMouseX
-
mouseX
,
mouseY
-
oldMouseY
)
var
newwidth
=
framerect
.
width
-
delta
adjustedFrame
=
framesize
adjustedFrame
.
width
=
Math
.
round
(
newwidth
/
root
.
scalex
);
adjustedFrame
.
height
=
Math
.
round
(
adjustedFrame
.
width
/
(
root
.
lockratio
>
0
?
root
.
lockratio
:
handleRatio
))
adjustedFrame
.
y
=
(
framerect
.
y
-
frame
.
y
)
/
root
.
scaley
+
framesize
.
height
-
adjustedFrame
.
height
;
framesize
=
adjustedFrame
}
else
{
framesize
.
width
=
(
framerect
.
width
+
(
mouseX
-
oldMouseX
))
/
root
.
scalex
;
framesize
.
y
=
(
framerect
.
y
+
(
mouseY
-
oldMouseY
)
-
frame
.
y
)
/
root
.
scaley
;
framesize
.
height
=
(
framerect
.
height
-
(
mouseY
-
oldMouseY
))
/
root
.
scaley
;
adjustedFrame
.
width
=
(
framerect
.
width
+
(
mouseX
-
oldMouseX
))
/
root
.
scalex
;
adjustedFrame
.
y
=
(
framerect
.
y
+
(
mouseY
-
oldMouseY
)
-
frame
.
y
)
/
root
.
scaley
;
adjustedFrame
.
height
=
(
framerect
.
height
-
(
mouseY
-
oldMouseY
))
/
root
.
scaley
;
}
if
(
mouse
.
modifiers
&
Qt
.
ControlModifier
)
{
var
xOffset
=
framesize
.
width
-
adjustedFrame
.
width
adjustedFrame
.
x
+=
xOffset
adjustedFrame
.
width
-=
xOffset
adjustedFrame
.
height
-=
(
framesize
.
height
-
adjustedFrame
.
height
)
}
framesize
=
adjustedFrame
root
.
effectChanged
()
}
}
...
...
@@ -390,17 +400,25 @@ Item {
}
onPositionChanged
:
{
if
(
pressed
)
{
adjustedFrame
=
framesize
if
(
root
.
lockratio
>
0
||
mouse
.
modifiers
&
Qt
.
ShiftModifier
)
{
var
delta
=
Math
.
max
(
mouseX
-
oldMouseX
,
oldMouseY
-
mouseY
)
var
newwidth
=
framerect
.
width
-
delta
framesiz
e
.
x
=
(
framerect
.
x
+
(
framerect
.
width
-
newwidth
)
-
frame
.
x
)
/
root
.
scalex
;
framesiz
e
.
width
=
Math
.
round
(
newwidth
/
root
.
scalex
);
framesize
.
height
=
Math
.
round
(
framesiz
e
.
width
/
(
root
.
lockratio
>
0
?
root
.
lockratio
:
handleRatio
))
adjustedFram
e
.
x
=
(
framerect
.
x
+
(
framerect
.
width
-
newwidth
)
-
frame
.
x
)
/
root
.
scalex
;
adjustedFram
e
.
width
=
Math
.
round
(
newwidth
/
root
.
scalex
);
adjustedFrame
.
height
=
Math
.
round
(
adjustedFram
e
.
width
/
(
root
.
lockratio
>
0
?
root
.
lockratio
:
handleRatio
))
}
else
{
framesiz
e
.
x
=
(
framerect
.
x
+
(
mouseX
-
oldMouseX
)
-
frame
.
x
)
/
root
.
scalex
;
framesiz
e
.
width
=
(
framerect
.
width
-
(
mouseX
-
oldMouseX
))
/
root
.
scalex
;
framesiz
e
.
height
=
(
framerect
.
height
+
(
mouseY
-
oldMouseY
))
/
root
.
scaley
;
adjustedFram
e
.
x
=
(
framerect
.
x
+
(
mouseX
-
oldMouseX
)
-
frame
.
x
)
/
root
.
scalex
;
adjustedFram
e
.
width
=
(
framerect
.
width
-
(
mouseX
-
oldMouseX
))
/
root
.
scalex
;
adjustedFram
e
.
height
=
(
framerect
.
height
+
(
mouseY
-
oldMouseY
))
/
root
.
scaley
;
}
if
(
mouse
.
modifiers
&
Qt
.
ControlModifier
)
{
adjustedFrame
.
width
-=
(
framesize
.
width
-
adjustedFrame
.
width
)
var
yOffset
=
framesize
.
height
-
adjustedFrame
.
height
adjustedFrame
.
y
+=
yOffset
adjustedFrame
.
height
-=
yOffset
}
framesize
=
adjustedFrame
root
.
effectChanged
()
}
}
...
...
@@ -448,15 +466,25 @@ Item {
}
onPositionChanged
:
{
if
(
pressed
)
{
adjustedFrame
=
framesize
if
(
root
.
lockratio
>
0
||
mouse
.
modifiers
&
Qt
.
ShiftModifier
)
{
var
delta
=
Math
.
max
(
oldMouseX
-
mouseX
,
oldMouseY
-
mouseY
)
var
newwidth
=
framerect
.
width
-
delta
framesiz
e
.
width
=
Math
.
round
(
newwidth
/
root
.
scalex
);
framesize
.
height
=
Math
.
round
(
framesiz
e
.
width
/
(
root
.
lockratio
>
0
?
root
.
lockratio
:
handleRatio
))
adjustedFram
e
.
width
=
Math
.
round
(
newwidth
/
root
.
scalex
);
adjustedFrame
.
height
=
Math
.
round
(
adjustedFram
e
.
width
/
(
root
.
lockratio
>
0
?
root
.
lockratio
:
handleRatio
))
}
else
{
framesize
.
width
=
(
framerect
.
width
+
(
mouseX
-
oldMouseX
))
/
root
.
scalex
;
framesize
.
height
=
(
framerect
.
height
+
(
mouseY
-
oldMouseY
))
/
root
.
scaley
;
adjustedFrame
.
width
=
(
framerect
.
width
+
(
mouseX
-
oldMouseX
))
/
root
.
scalex
;
adjustedFrame
.
height
=
(
framerect
.
height
+
(
mouseY
-
oldMouseY
))
/
root
.
scaley
;
}
if
(
mouse
.
modifiers
&
Qt
.
ControlModifier
)
{
var
xOffset
=
framesize
.
width
-
adjustedFrame
.
width
adjustedFrame
.
x
+=
xOffset
adjustedFrame
.
width
-=
xOffset
var
yOffset
=
framesize
.
height
-
adjustedFrame
.
height
adjustedFrame
.
y
+=
yOffset
adjustedFrame
.
height
-=
yOffset
}
framesize
=
adjustedFrame
root
.
effectChanged
()
}
}
...
...
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