Fix weird decoration glitch when using a scaled display
We used to get a weird line around the window decoration because the clamping would hit the outside of the rendered decoration. To make sure we fall inside take the displayPixelRatio into account. Also on non-integer scales, make sure we are actually falling inside.
This commit is contained in:
parent
7bf79090cf
commit
aba3335ea6
1 changed files with 3 additions and 1 deletions
|
@ -2588,7 +2588,9 @@ void SceneOpenGLDecorationRenderer::render(const QRegion ®ion)
|
|||
renderToPainter(&painter, geo);
|
||||
painter.end();
|
||||
|
||||
clamp(image, QRect(viewport.topLeft(), viewport.size() * devicePixelRatio));
|
||||
const QRect viewportScaled(viewport.topLeft() * devicePixelRatio, viewport.size() * devicePixelRatio);
|
||||
const bool isIntegerScaling = qFuzzyCompare(devicePixelRatio, std::ceil(devicePixelRatio));
|
||||
clamp(image, isIntegerScaling ? viewportScaled : viewportScaled.marginsRemoved({1, 1, 1, 1}));
|
||||
|
||||
if (rotated) {
|
||||
// TODO: get this done directly when rendering to the image
|
||||
|
|
Loading…
Reference in a new issue