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
e544b872
Commit
e544b872
authored
Feb 06, 2020
by
Jean-Baptiste Mardelle
Browse files
Fix frame size in monitor overlay with non square pixels
parent
9633446d
Pipeline
#14566
passed with stage
in 26 minutes and 31 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/monitor/monitor.cpp
View file @
e544b872
...
...
@@ -1924,8 +1924,7 @@ void Monitor::loadQmlScene(MonitorSceneType type)
pCore
->
displayMessage
(
i18n
(
"Enable edit mode in monitor to edit effect"
),
InformationMessage
,
500
);
type
=
MonitorSceneDefault
;
}
double
ratio
=
(
double
)
m_glMonitor
->
profileSize
().
width
()
/
(
int
)(
m_glMonitor
->
profileSize
().
height
()
*
pCore
->
getCurrentProfile
()
->
dar
()
+
0.5
);
m_qmlManager
->
setScene
(
m_id
,
type
,
pCore
->
getCurrentFrameSize
(),
ratio
,
m_glMonitor
->
displayRect
(),
m_glMonitor
->
zoom
(),
m_timePos
->
maximum
());
m_qmlManager
->
setScene
(
m_id
,
type
,
pCore
->
getCurrentFrameSize
(),
pCore
->
getCurrentDar
(),
m_glMonitor
->
displayRect
(),
m_glMonitor
->
zoom
(),
m_timePos
->
maximum
());
QQuickItem
*
root
=
m_glMonitor
->
rootObject
();
switch
(
type
)
{
case
MonitorSceneSplit
:
...
...
src/monitor/qmlmanager.cpp
View file @
e544b872
...
...
@@ -56,6 +56,10 @@ void QmlManager::setScene(Kdenlive::MonitorId id, MonitorSceneType type, QSize p
QQuickItem
*
root
=
nullptr
;
const
QFont
ft
=
QFontDatabase
::
systemFont
(
QFontDatabase
::
FixedFont
);
m_view
->
rootContext
()
->
setContextProperty
(
"fixedFont"
,
ft
);
double
scalex
=
(
double
)
displayRect
.
width
()
/
profile
.
width
()
*
zoom
;
double
scaley
=
displayRect
.
width
()
/
((
double
)
profile
.
height
()
*
profileStretch
/
profile
.
width
())
/
profile
.
width
()
*
zoom
;
switch
(
type
)
{
case
MonitorSceneGeometry
:
m_view
->
setSource
(
QUrl
(
QStringLiteral
(
"qrc:/qml/kdenlivemonitoreffectscene.qml"
)));
...
...
@@ -64,19 +68,18 @@ void QmlManager::setScene(Kdenlive::MonitorId id, MonitorSceneType type, QSize p
QObject
::
connect
(
root
,
SIGNAL
(
centersChanged
()),
this
,
SLOT
(
effectPolygonChanged
()),
Qt
::
UniqueConnection
);
root
->
setProperty
(
"profile"
,
QPoint
(
profile
.
width
(),
profile
.
height
()));
root
->
setProperty
(
"framesize"
,
QRect
(
0
,
0
,
profile
.
width
(),
profile
.
height
()));
root
->
setProperty
(
"scalex"
,
(
double
)
displayRect
.
width
()
/
profile
.
width
()
*
zoom
);
root
->
setProperty
(
"scaley"
,
(
double
)
displayRect
.
width
()
/
profileStretch
/
profile
.
width
()
*
zoom
);
root
->
setProperty
(
"scalex"
,
scalex
);
root
->
setProperty
(
"scaley"
,
scaley
);
root
->
setProperty
(
"center"
,
displayRect
.
center
());
break
;
case
MonitorSceneCorners
:
qDebug
()
<<
"/// LOADING CORNERS SCENE
\n\n
+++++++++++++++++++++++++
\n
------------------
\n
+++++++++++++++++"
;
m_view
->
setSource
(
QUrl
(
QStringLiteral
(
"qrc:/qml/kdenlivemonitorcornerscene.qml"
)));
root
=
m_view
->
rootObject
();
QObject
::
connect
(
root
,
SIGNAL
(
effectPolygonChanged
()),
this
,
SLOT
(
effectPolygonChanged
()),
Qt
::
UniqueConnection
);
root
->
setProperty
(
"profile"
,
QPoint
(
profile
.
width
(),
profile
.
height
()));
root
->
setProperty
(
"framesize"
,
QRect
(
0
,
0
,
profile
.
width
(),
profile
.
height
()));
root
->
setProperty
(
"scalex"
,
(
double
)
displayRect
.
width
()
/
profile
.
width
()
*
zoom
);
root
->
setProperty
(
"scaley"
,
(
double
)
displayRect
.
width
()
/
profileStretch
/
profile
.
width
()
*
zoom
);
root
->
setProperty
(
"scalex"
,
scalex
);
root
->
setProperty
(
"scaley"
,
scaley
);
root
->
setProperty
(
"stretch"
,
profileStretch
);
root
->
setProperty
(
"center"
,
displayRect
.
center
());
break
;
...
...
@@ -86,8 +89,8 @@ void QmlManager::setScene(Kdenlive::MonitorId id, MonitorSceneType type, QSize p
QObject
::
connect
(
root
,
SIGNAL
(
effectPolygonChanged
()),
this
,
SLOT
(
effectRotoChanged
()),
Qt
::
UniqueConnection
);
root
->
setProperty
(
"profile"
,
QPoint
(
profile
.
width
(),
profile
.
height
()));
root
->
setProperty
(
"framesize"
,
QRect
(
0
,
0
,
profile
.
width
(),
profile
.
height
()));
root
->
setProperty
(
"scalex"
,
(
double
)
displayRect
.
width
()
/
profile
.
width
()
*
zoom
);
root
->
setProperty
(
"scaley"
,
(
double
)
displayRect
.
width
()
/
profileStretch
/
profile
.
width
()
*
zoom
);
root
->
setProperty
(
"scalex"
,
scalex
);
root
->
setProperty
(
"scaley"
,
scaley
);
root
->
setProperty
(
"stretch"
,
profileStretch
);
root
->
setProperty
(
"center"
,
displayRect
.
center
());
break
;
...
...
@@ -95,8 +98,8 @@ void QmlManager::setScene(Kdenlive::MonitorId id, MonitorSceneType type, QSize p
m_view
->
setSource
(
QUrl
(
QStringLiteral
(
"qrc:/qml/kdenlivemonitorsplit.qml"
)));
root
=
m_view
->
rootObject
();
root
->
setProperty
(
"profile"
,
QPoint
(
profile
.
width
(),
profile
.
height
()));
root
->
setProperty
(
"scalex"
,
(
double
)
displayRect
.
width
()
/
profile
.
width
()
*
zoom
);
root
->
setProperty
(
"scaley"
,
(
double
)
displayRect
.
width
()
/
profileStretch
/
profile
.
width
()
*
zoom
);
root
->
setProperty
(
"scalex"
,
scalex
);
root
->
setProperty
(
"scaley"
,
scaley
);
break
;
case
MonitorSceneRipple
:
m_view
->
setSource
(
QUrl
(
QStringLiteral
(
"qrc:/qml/kdenlivemonitorripple.qml"
)));
...
...
@@ -107,8 +110,8 @@ void QmlManager::setScene(Kdenlive::MonitorId id, MonitorSceneType type, QSize p
QUrl
(
id
==
Kdenlive
::
ClipMonitor
?
QStringLiteral
(
"qrc:/qml/kdenliveclipmonitor.qml"
)
:
QStringLiteral
(
"qrc:/qml/kdenlivemonitor.qml"
)));
root
=
m_view
->
rootObject
();
root
->
setProperty
(
"profile"
,
QPoint
(
profile
.
width
(),
profile
.
height
()));
root
->
setProperty
(
"scalex"
,
(
double
)
displayRect
.
width
()
/
profile
.
width
()
*
zoom
);
root
->
setProperty
(
"scaley"
,
(
double
)
displayRect
.
width
()
/
profileStretch
/
profile
.
width
()
*
zoom
);
root
->
setProperty
(
"scalex"
,
scalex
);
root
->
setProperty
(
"scaley"
,
scaley
);
break
;
}
if
(
root
&&
duration
>
0
)
{
...
...
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