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
b729c5c7
Commit
b729c5c7
authored
Apr 07, 2022
by
Jean-Baptiste Mardelle
Browse files
Fix monitor image size with non integer screen scaling.
Fixes
#1392
parent
7e0067a7
Pipeline
#160980
passed with stage
in 5 minutes and 50 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/monitor/glwidget.cpp
View file @
b729c5c7
...
...
@@ -508,13 +508,13 @@ bool GLWidget::initGPUAccelSync()
void
GLWidget
::
paintGL
()
{
QOpenGLFunctions
*
f
=
quickWindow
()
->
openglContext
()
->
functions
();
float
width
=
float
(
this
->
width
()
*
devicePixelRatio
(
)
);
float
height
=
float
(
this
->
height
()
*
devicePixelRatio
(
)
);
float
width
=
this
->
width
()
*
devicePixelRatio
F
();
float
height
=
this
->
height
()
*
devicePixelRatio
F
();
f
->
glDisable
(
GL_BLEND
);
f
->
glDisable
(
GL_DEPTH_TEST
);
f
->
glDepthMask
(
GL_FALSE
);
f
->
glViewport
(
0
,
qRound
(
m_displayRulerHeight
*
devicePixelRatio
()
*
0.5
),
int
(
width
),
int
(
height
));
f
->
glViewport
(
0
,
qRound
(
m_displayRulerHeight
*
devicePixelRatio
F
()
*
0.5
),
int
(
width
),
int
(
height
));
check_error
(
f
);
f
->
glClearColor
(
float
(
m_bgColor
.
redF
()),
float
(
m_bgColor
.
greenF
()),
float
(
m_bgColor
.
blueF
()),
0
);
f
->
glClear
(
GL_COLOR_BUFFER_BIT
);
...
...
@@ -543,7 +543,7 @@ void GLWidget::paintGL()
// Set model view.
QMatrix4x4
modelView
;
if
(
!
qFuzzyCompare
(
m_zoom
,
1.0
f
))
{
if
((
offset
().
x
()
!=
0
)
||
(
offset
().
y
()
!=
0
))
modelView
.
translate
(
float
(
-
offset
().
x
()
*
devicePixelRatio
(
)
),
float
(
offset
().
y
()
*
devicePixelRatio
(
)
));
if
((
offset
().
x
()
!=
0
)
||
(
offset
().
y
()
!=
0
))
modelView
.
translate
(
-
offset
().
x
()
*
devicePixelRatio
F
(),
offset
().
y
()
*
devicePixelRatio
F
());
modelView
.
scale
(
zoom
(),
zoom
());
}
m_shader
->
setUniformValue
(
m_modelViewLocation
,
modelView
);
...
...
@@ -551,8 +551,8 @@ void GLWidget::paintGL()
// Provide vertices of triangle strip.
QVector
<
QVector2D
>
vertices
;
width
=
float
(
m_rect
.
width
()
*
devicePixelRatio
(
)
);
height
=
float
(
m_rect
.
height
()
*
devicePixelRatio
(
)
);
width
=
m_rect
.
width
()
*
devicePixelRatio
F
();
height
=
m_rect
.
height
()
*
devicePixelRatio
F
();
vertices
<<
QVector2D
(
-
width
/
2.0
f
,
-
height
/
2.0
f
);
vertices
<<
QVector2D
(
-
width
/
2.0
f
,
height
/
2.0
f
);
vertices
<<
QVector2D
(
width
/
2.0
f
,
-
height
/
2.0
f
);
...
...
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