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
cef3b29a
Commit
cef3b29a
authored
Feb 26, 2022
by
Jean-Baptiste Mardelle
Browse files
Fix 1 pixel offset at some zoom factors.
Fixes
#1347
parent
664c4361
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/timeline2/view/qml/Clip.qml
View file @
cef3b29a
...
...
@@ -58,6 +58,7 @@ Rectangle {
property
int
originalDuration
:
clipDuration
property
int
lastValidDuration
:
clipDuration
property
int
draggedX
:
x
property
double
xIntegerOffset
:
0
property
bool
selected
:
false
property
bool
isLocked
:
parentTrack
&&
parentTrack
.
isLocked
===
true
property
bool
hasAudio
...
...
@@ -131,7 +132,7 @@ Rectangle {
}*/
onClipDurationChanged
:
{
width
=
Math
.
round
(
clipDuration
*
timeScale
)
width
=
clipDuration
*
timeScale
if
(
parentTrack
&&
parentTrack
.
isAudio
&&
thumbsLoader
.
item
)
{
// Duration changed, we may need a different number of repeaters
thumbsLoader
.
item
.
reload
(
1
)
...
...
@@ -139,11 +140,13 @@ Rectangle {
}
onModelStartChanged
:
{
x
=
Math
.
round
(
modelStart
*
timeScale
);
x
=
modelStart
*
timeScale
xIntegerOffset
=
Math
.
ceil
(
x
)
-
x
}
onFakePositionChanged
:
{
x
=
Math
.
round
(
fakePosition
*
timeScale
);
x
=
fakePosition
*
timeScale
xIntegerOffset
=
Math
.
ceil
(
x
)
-
x
}
onFakeTidChanged
:
{
if
(
clipRoot
.
fakeTid
>
-
1
&&
parentTrack
)
{
...
...
@@ -167,8 +170,9 @@ Rectangle {
}
onTimeScaleChanged
:
{
x
=
Math
.
round
(
modelStart
*
timeScale
);
width
=
Math
.
round
(
clipDuration
*
timeScale
);
x
=
modelStart
*
timeScale
;
xIntegerOffset
=
Math
.
ceil
(
x
)
-
x
width
=
clipDuration
*
timeScale
;
updateLabelOffset
()
if
(
!
clipRoot
.
hideClipViews
)
{
if
(
effectRow
.
item
&&
effectRow
.
item
.
kfrCanvas
)
{
...
...
@@ -351,8 +355,8 @@ Rectangle {
// Thumbs container
id
:
thumbsLoader
anchors.fill
:
parent
anchors.leftMargin
:
parentTrack
.
isAudio
?
0
:
itemBorder
.
border
.
width
+
mixContainer
.
width
anchors.rightMargin
:
parentTrack
.
isAudio
?
0
:
itemBorder
.
border
.
width
anchors.leftMargin
:
parentTrack
.
isAudio
?
xIntegerOffset
:
itemBorder
.
border
.
width
+
mixContainer
.
width
anchors.rightMargin
:
parentTrack
.
isAudio
?
clipRoot
.
width
-
Math
.
floor
(
clipRoot
.
width
)
:
itemBorder
.
border
.
width
anchors.topMargin
:
itemBorder
.
border
.
width
anchors.bottomMargin
:
itemBorder
.
border
.
width
//clip: true
...
...
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