From b3c78ea81a2040bdd9ea97ef87b479e5e28cca29 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Tue, 5 Mar 2024 21:56:10 +0100 Subject: [PATCH] Fix animated images rendering offscreen for the first frame --- src/ui/MxcAnimatedImage.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ui/MxcAnimatedImage.cpp b/src/ui/MxcAnimatedImage.cpp index ffe54c71..f536b39f 100644 --- a/src/ui/MxcAnimatedImage.cpp +++ b/src/ui/MxcAnimatedImage.cpp @@ -175,7 +175,9 @@ MxcAnimatedImage::updatePaintNode(QSGNode *oldNode, QQuickItem::UpdatePaintNodeD if (!imageDirty) return oldNode; - if (clipRect().isEmpty()) + // If the image is offscreen, just return the old node (if it exists) to save on animation CPU + // use. Don't return null here, or you will never be called again. + if (clipRect().isEmpty() && oldNode) return oldNode; imageDirty = false;