From 8ba77139e39df344a8eef97e130a8c7d750d5fc3 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Wed, 14 Sep 2022 14:21:33 +0000 Subject: [PATCH] Fix truncation in quad clipping Transforms may not be on the logical grid in the case of CSD clients with scaling. --- src/scenes/opengl/scene_opengl.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/scenes/opengl/scene_opengl.cpp b/src/scenes/opengl/scene_opengl.cpp index bc9e6bd302..3b070dcf01 100644 --- a/src/scenes/opengl/scene_opengl.cpp +++ b/src/scenes/opengl/scene_opengl.cpp @@ -288,15 +288,14 @@ static WindowQuadList clipQuads(const Item *item, const SceneOpenGL::RenderConte { const WindowQuadList quads = item->quads(); if (context->clip != infiniteRegion() && !context->hardwareClipping) { - const QPoint offset = context->transformStack.top().map(QPoint(0, 0)); - + const QPointF offset = context->transformStack.top().map(QPointF(0, 0)); WindowQuadList ret; ret.reserve(quads.count()); // split all quads in bounding rect with the actual rects in the region for (const WindowQuad &quad : qAsConst(quads)) { for (const QRect &r : qAsConst(context->clip)) { - const QRectF rf(r.translated(-offset)); + const QRectF rf(QRectF(r).translated(-offset)); const QRectF quadRect(QPointF(quad.left(), quad.top()), QPointF(quad.right(), quad.bottom())); const QRectF &intersected = rf.intersected(quadRect); if (intersected.isValid()) {