plugins/screenshot: Invert render transforms in the correct order

The render transform is applied first, after that, the texture is
flipped implicitly by opengl.

So in order to undo these transforms, we need to flip the image
vertically first, then undo the render target transform.
This commit is contained in:
Vlad Zahorodnii 2023-12-20 16:48:45 +02:00
parent 16809e6b15
commit 27821e3c76

View file

@ -76,10 +76,10 @@ static void convertFromGLImage(QImage &img, int w, int h, const OutputTransform
}
QMatrix4x4 matrix;
// OpenGL textures are flipped vs QImage
matrix.scale(1, -1);
// apply render target transformation
matrix *= renderTargetTransformation.inverted().toMatrix();
// OpenGL textures are flipped vs QImage
matrix.scale(1, -1);
img = img.transformed(matrix.toTransform());
}