diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2024-03-05 21:56:10 +0100 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2024-03-05 21:56:10 +0100 |
commit | b3c78ea81a2040bdd9ea97ef87b479e5e28cca29 (patch) | |
tree | 94071c4b9e3edc8ea004caaa8387f0e2481c1734 /src | |
parent | Prevent big images from becoming square in overlay (diff) | |
download | nheko-b3c78ea81a2040bdd9ea97ef87b479e5e28cca29.tar.xz |
Fix animated images rendering offscreen for the first frame
Diffstat (limited to 'src')
-rw-r--r-- | src/ui/MxcAnimatedImage.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
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; |