Only recalculate renderTargetMatrix if it is needed

If there's no changes then there's no need to recalculate the projection
matrix.
This commit is contained in:
Arjen Hiemstra 2022-07-15 15:25:45 +02:00
parent 695cc7c010
commit 3922f468b4

View file

@ -428,6 +428,10 @@ QRect Scene::renderTargetRect() const
void Scene::setRenderTargetRect(const QRect &rect)
{
if (rect == m_renderTargetRect) {
return;
}
m_renderTargetRect = rect;
m_renderTargetProjectionMatrix = createProjectionMatrix(rect);
}