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
261
Issues
261
List
Boards
Labels
Service Desk
Milestones
Merge Requests
16
Merge Requests
16
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
a2b2d505
Commit
a2b2d505
authored
Mar 25, 2017
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix locked ratio scaling
parent
66cfda93
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
19 deletions
+61
-19
data/kdenlivemonitoreffectscene.qml
data/kdenlivemonitoreffectscene.qml
+61
-18
src/effectstack/widgets/animationwidget.cpp
src/effectstack/widgets/animationwidget.cpp
+0
-1
No files found.
data/kdenlivemonitoreffectscene.qml
View file @
a2b2d505
...
...
@@ -9,6 +9,7 @@ Item {
property
string
comment
property
string
framenum
property
rect
framesize
property
rect
adjustedFrame
property
point
profile
property
point
center
property
double
zoom
...
...
@@ -241,23 +242,33 @@ Item {
anchors.centerIn
:
parent
hoverEnabled
:
true
cursorShape
:
Qt
.
SizeFDiagCursor
onEntered
:
{
tlhandle
.
color
=
'
#ffff00
'
}
onExited
:
{
tlhandle
.
color
=
'
#ff0000
'
}
onEntered
:
{
if
(
!
pressed
)
{
tlhandle
.
color
=
'
#ffff00
'
}
}
onExited
:
{
if
(
!
pressed
)
{
tlhandle
.
color
=
'
#ff0000
'
}
}
onPressed
:
{
oldMouseX
=
mouseX
oldMouseY
=
mouseY
effectsize
.
visible
=
true
tlhandle
.
color
=
'
#ffff00
'
}
onPositionChanged
:
{
if
(
pressed
)
{
if
(
root
.
lockratio
>
0
)
{
var
delta
=
Math
.
max
(
mouseX
-
oldMouseX
,
mouseY
-
oldMouseY
)
var
newwidth
=
framerect
.
width
-
delta
var
newheight
=
newwidth
/
root
.
lockratio
framesize
.
x
=
(
framerect
.
x
+
(
framerect
.
width
-
newwidth
)
-
frame
.
x
)
/
root
.
scalex
;
framesize
.
width
=
Math
.
round
(
newwidth
/
root
.
scalex
);
framesize
.
y
=
(
framerect
.
y
+
(
framerect
.
height
-
newheight
)
-
frame
.
y
)
/
root
.
scaley
;
framesize
.
height
=
Math
.
round
(
framesize
.
width
/
root
.
lockratio
)
adjustedFrame
=
framesize
adjustedFrame
.
width
=
Math
.
round
(
newwidth
/
root
.
scalex
);
adjustedFrame
.
height
=
Math
.
round
(
adjustedFrame
.
width
/
root
.
lockratio
)
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
{
framesize
.
x
=
(
framerect
.
x
+
(
mouseX
-
oldMouseX
)
-
frame
.
x
)
/
root
.
scalex
;
framesize
.
width
=
(
framerect
.
width
-
(
mouseX
-
oldMouseX
))
/
root
.
scalex
;
...
...
@@ -269,6 +280,7 @@ Item {
}
onReleased
:
{
effectsize
.
visible
=
false
tlhandle
.
color
=
'
#ff0000
'
}
}
Text
{
...
...
@@ -300,22 +312,32 @@ Item {
anchors.centerIn
:
parent
hoverEnabled
:
true
cursorShape
:
Qt
.
SizeBDiagCursor
onEntered
:
{
trhandle
.
color
=
'
#ffff00
'
}
onExited
:
{
trhandle
.
color
=
'
#ff0000
'
}
onEntered
:
{
if
(
!
pressed
)
{
trhandle
.
color
=
'
#ffff00
'
}
}
onExited
:
{
if
(
!
pressed
)
{
trhandle
.
color
=
'
#ff0000
'
}
}
onPressed
:
{
oldMouseX
=
mouseX
oldMouseY
=
mouseY
effectsize
.
visible
=
true
trhandle
.
color
=
'
#ffff00
'
}
onPositionChanged
:
{
if
(
pressed
)
{
if
(
root
.
lockratio
>
0
)
{
var
delta
=
Math
.
max
(
oldMouseX
-
mouseX
,
mouseY
-
oldMouseY
)
var
newheight
=
framerect
.
height
-
delta
var
newwidth
=
newheight
*
root
.
lockratio
framesize
.
y
=
(
framerect
.
y
+
(
framerect
.
height
-
newheight
)
-
frame
.
y
)
/
root
.
scaley
;
framesize
.
width
=
Math
.
round
(
newwidth
/
root
.
scalex
);
framesize
.
height
=
Math
.
round
(
framesize
.
width
/
root
.
lockratio
)
var
newwidth
=
framerect
.
width
-
delta
adjustedFrame
=
framesize
adjustedFrame
.
width
=
Math
.
round
(
newwidth
/
root
.
scalex
);
adjustedFrame
.
height
=
Math
.
round
(
adjustedFrame
.
width
/
root
.
lockratio
)
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
;
...
...
@@ -326,6 +348,7 @@ Item {
}
onReleased
:
{
effectsize
.
visible
=
false
trhandle
.
color
=
'
#ff0000
'
}
}
}
...
...
@@ -346,12 +369,21 @@ Item {
anchors.centerIn
:
parent
hoverEnabled
:
true
cursorShape
:
Qt
.
SizeBDiagCursor
onEntered
:
{
blhandle
.
color
=
'
#ffff00
'
}
onExited
:
{
blhandle
.
color
=
'
#ff0000
'
}
onEntered
:
{
if
(
!
pressed
)
{
blhandle
.
color
=
'
#ffff00
'
}
}
onExited
:
{
if
(
!
pressed
)
{
blhandle
.
color
=
'
#ff0000
'
}
}
onPressed
:
{
oldMouseX
=
mouseX
oldMouseY
=
mouseY
effectsize
.
visible
=
true
blhandle
.
color
=
'
#ffff00
'
}
onPositionChanged
:
{
if
(
pressed
)
{
...
...
@@ -371,6 +403,7 @@ Item {
}
onReleased
:
{
effectsize
.
visible
=
false
blhandle
.
color
=
'
#ff0000
'
}
}
}
...
...
@@ -391,12 +424,21 @@ Item {
anchors.centerIn
:
parent
hoverEnabled
:
true
cursorShape
:
Qt
.
SizeFDiagCursor
onEntered
:
{
brhandle
.
color
=
'
#ffff00
'
}
onExited
:
{
brhandle
.
color
=
'
#ff0000
'
}
onEntered
:
{
if
(
!
pressed
)
{
brhandle
.
color
=
'
#ffff00
'
}
}
onExited
:
{
if
(
!
pressed
)
{
brhandle
.
color
=
'
#ff0000
'
}
}
onPressed
:
{
oldMouseX
=
mouseX
oldMouseY
=
mouseY
effectsize
.
visible
=
true
brhandle
.
color
=
'
#ffff00
'
}
onPositionChanged
:
{
if
(
pressed
)
{
...
...
@@ -414,6 +456,7 @@ Item {
}
onReleased
:
{
effectsize
.
visible
=
false
brhandle
.
color
=
'
#ff0000
'
}
}
Text
{
...
...
src/effectstack/widgets/animationwidget.cpp
View file @
a2b2d505
...
...
@@ -514,7 +514,6 @@ void AnimationWidget::slotPositionChanged(int pos, bool seek)
if
(
m_spinWidth
&&
m_spinWidth
->
isEnabled
())
{
double
ratio
=
m_originalSize
->
isChecked
()
?
(
double
)
m_frameSize
.
x
()
/
m_frameSize
.
y
()
:
(
double
)
m_monitor
->
render
->
frameRenderWidth
()
/
m_monitor
->
render
->
renderHeight
();
bool
lockRatio
=
m_spinHeight
->
value
()
==
(
int
)
(
m_spinWidth
->
value
()
/
ratio
+
0.5
);
qDebug
()
<<
"CALCULATED: "
<<
m_spinHeight
->
value
()
<<
" = "
<<
(
int
)
(
m_spinWidth
->
value
()
/
ratio
+
0.5
);
m_lockRatio
->
blockSignals
(
true
);
m_lockRatio
->
setChecked
(
lockRatio
);
m_lockRatio
->
blockSignals
(
false
);
...
...
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