summary refs log tree commit diff
path: root/src/ui/MxcAnimatedImage.cpp
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2023-10-10 00:33:39 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2023-10-10 00:33:39 +0200
commit3a0d5788e1fc49816742ddd4799ad0d658925ba2 (patch)
tree55686a2e0bd354260ebd8c17fedb755b5d0d131c /src/ui/MxcAnimatedImage.cpp
parentTranslated using Weblate (French) (diff)
parentRestore reply context menu (diff)
downloadnheko-3a0d5788e1fc49816742ddd4799ad0d658925ba2.tar.xz
Merge branch 'delegate-rework'
Diffstat (limited to 'src/ui/MxcAnimatedImage.cpp')
-rw-r--r--src/ui/MxcAnimatedImage.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/ui/MxcAnimatedImage.cpp b/src/ui/MxcAnimatedImage.cpp

index 14f5dbd8..ffe54c71 100644 --- a/src/ui/MxcAnimatedImage.cpp +++ b/src/ui/MxcAnimatedImage.cpp
@@ -102,10 +102,12 @@ MxcAnimatedImage::startDownload() if (buffer.bytesAvailable() < 4LL * 1024 * 1024 * 1024) // cache images smaller than 4MB in RAM movie.setCacheMode(QMovie::CacheAll); - if (play_) + if (play_ && movie.frameCount() > 1) movie.start(); - else + else { movie.jumpToFrame(0); + movie.setPaused(true); + } emit loadedChanged(); update(); }); @@ -173,6 +175,9 @@ MxcAnimatedImage::updatePaintNode(QSGNode *oldNode, QQuickItem::UpdatePaintNodeD if (!imageDirty) return oldNode; + if (clipRect().isEmpty()) + return oldNode; + imageDirty = false; QSGImageNode *n = static_cast<QSGImageNode *>(oldNode); if (!n) {