summary refs log tree commit diff
path: root/src/ui
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2022-05-11 12:28:27 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2022-05-11 12:28:27 +0200
commit908f62159a705c04c8a403d7d6dfe5ad1d96feec (patch)
tree162fe06d32f6d5108a584de712cfd6a3d1883ffa /src/ui
parentUse right linter (diff)
downloadnheko-908f62159a705c04c8a403d7d6dfe5ad1d96feec.tar.xz
Properly mark image node as dirty on size update
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/MxcAnimatedImage.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ui/MxcAnimatedImage.cpp b/src/ui/MxcAnimatedImage.cpp
index d4f54a69..8ecea7d9 100644
--- a/src/ui/MxcAnimatedImage.cpp
+++ b/src/ui/MxcAnimatedImage.cpp
@@ -162,6 +162,8 @@ MxcAnimatedImage::geometryChanged(const QRectF &newGeometry, const QRectF &oldGe
             QSizeF r = movie.scaledSize();
             r.scale(newGeometry.size(), Qt::KeepAspectRatio);
             movie.setScaledSize(r.toSize());
+            imageDirty = true;
+            update();
         }
     }
 }
@@ -182,7 +184,6 @@ MxcAnimatedImage::updatePaintNode(QSGNode *oldNode, QQuickItem::UpdatePaintNodeD
         n->setFlags(QSGNode::OwnedByParent);
     }
 
-    // n->setTexture(nullptr);
     auto img = movie.currentImage();
     n->setSourceRect(img.rect());
     if (!img.isNull())
@@ -193,8 +194,7 @@ MxcAnimatedImage::updatePaintNode(QSGNode *oldNode, QQuickItem::UpdatePaintNodeD
     }
 
     QSizeF r = img.size();
-    if (height() != 0 || width() != 0)
-        r.scale(size(), Qt::KeepAspectRatio);
+    r.scale(size(), Qt::KeepAspectRatio);
 
     n->setRect((width() - r.width()) / 2, (height() - r.height()) / 2, r.width(), r.height());
     n->setFiltering(QSGTexture::Linear);