Account for render target scale when rendering a WindowThumbnailItem

Otherwise we get too large and cut off window thumbnails.
This commit is contained in:
Arjen Hiemstra 2022-08-04 14:12:41 +02:00
parent 5a85ecd8c4
commit 74ff3bf082

View file

@ -433,9 +433,11 @@ void WindowThumbnailItem::updateOffscreenTexture()
glClearColor(0.0, 0.0, 0.0, 0.0);
glClear(GL_COLOR_BUFFER_BIT);
auto scale = Compositor::self()->scene()->renderTargetScale();
QMatrix4x4 projectionMatrix;
projectionMatrix.ortho(geometry.x(), geometry.x() + geometry.width(),
geometry.y(), geometry.y() + geometry.height(), -1, 1);
projectionMatrix.ortho(geometry.x() * scale, (geometry.x() + geometry.width()) * scale,
geometry.y() * scale, (geometry.y() + geometry.height()) * scale, -1, 1);
WindowPaintData data;
data.setProjectionMatrix(projectionMatrix);