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
f8471053
Commit
f8471053
authored
Jul 30, 2021
by
Jean-Baptiste Mardelle
Browse files
Fix geometry param (like tracker) not restoring value after save
parent
92d6af69
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/assets/view/widgets/geometryeditwidget.cpp
View file @
f8471053
...
...
@@ -39,12 +39,20 @@ GeometryEditWidget::GeometryEditWidget(std::shared_ptr<AssetParameterModel> mode
const
QString
value
=
m_model
->
data
(
m_index
,
AssetParameterModel
::
ValueRole
).
toString
().
simplified
();
int
start
=
m_model
->
data
(
m_index
,
AssetParameterModel
::
ParentInRole
).
toInt
();
int
end
=
start
+
m_model
->
data
(
m_index
,
AssetParameterModel
::
ParentDurationRole
).
toInt
();
QSize
profileSize
=
pCore
->
getCurrentFrameSize
();
Mlt
::
Properties
mlt_prop
;
m_model
->
passProperties
(
mlt_prop
);
mlt_prop
.
set
(
"rect"
,
value
.
toUtf8
().
data
());
mlt_rect
r
=
mlt_prop
.
get_rect
(
"rect"
);
QRect
rect
=
QRect
(
int
(
profileSize
.
width
()
*
r
.
x
),
int
(
profileSize
.
height
()
*
r
.
y
),
int
(
profileSize
.
width
()
*
r
.
w
),
int
(
profileSize
.
height
()
*
r
.
h
));;
QRect
rect
;
if
(
value
.
contains
(
QLatin1Char
(
'%'
)))
{
QSize
profileSize
=
pCore
->
getCurrentFrameSize
();
Mlt
::
Properties
mlt_prop
;
m_model
->
passProperties
(
mlt_prop
);
mlt_prop
.
set
(
"rect"
,
value
.
toUtf8
().
data
());
mlt_rect
r
=
mlt_prop
.
get_rect
(
"rect"
);
rect
=
QRect
(
int
(
profileSize
.
width
()
*
r
.
x
),
int
(
profileSize
.
height
()
*
r
.
y
),
int
(
profileSize
.
width
()
*
r
.
w
),
int
(
profileSize
.
height
()
*
r
.
h
));;
}
else
{
QStringList
vals
=
value
.
split
(
QLatin1Char
(
' '
));
if
(
vals
.
count
()
>=
4
)
{
rect
=
QRect
(
vals
.
at
(
0
).
toInt
(),
vals
.
at
(
1
).
toInt
(),
vals
.
at
(
2
).
toInt
(),
vals
.
at
(
3
).
toInt
());
}
}
if
(
rect
.
isNull
())
{
// Cannot read value, use random default
rect
=
QRect
(
50
,
50
,
200
,
200
);
...
...
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