diff options
| author | Méven Car <[email protected]> | 2026-03-09 11:46:14 +0100 |
|---|---|---|
| committer | Méven Car <[email protected]> | 2026-03-10 09:04:17 +0000 |
| commit | 359ba4c0700ff43a68ad62517bf7c638c341be8a (patch) | |
| tree | ea68037e5d6101d842678b011ce40424236c6dbb | |
| parent | 7ee0bf112706be1b4f774713d0421a63dd56ff44 (diff) | |
information/pixmapviewer: handle hdipi for animated images
BUG: 510829
| -rw-r--r-- | src/panels/information/pixmapviewer.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/panels/information/pixmapviewer.cpp b/src/panels/information/pixmapviewer.cpp index 9ac9bd253..4f3f9e82f 100644 --- a/src/panels/information/pixmapviewer.cpp +++ b/src/panels/information/pixmapviewer.cpp @@ -54,6 +54,7 @@ void PixmapViewer::setPixmap(const QPixmap &pixmap) void PixmapViewer::setSizeHint(const QSize &size) { if (m_animatedImage && size != m_sizeHint) { + m_animatedImage->setScaledSize(QSize()); m_animatedImage->stop(); } @@ -104,10 +105,12 @@ void PixmapViewer::updateAnimatedImageFrame() Q_ASSERT(m_animatedImage); m_pixmap = m_animatedImage->currentPixmap(); - if (m_pixmap.width() > m_sizeHint.width() || m_pixmap.height() > m_sizeHint.height()) { - m_pixmap = m_pixmap.scaled(m_sizeHint, Qt::KeepAspectRatio); + const auto physicalSize = m_sizeHint * devicePixelRatio(); + if (m_pixmap.width() > physicalSize.width() || m_pixmap.height() > physicalSize.height()) { + m_pixmap = m_pixmap.scaled(physicalSize, Qt::KeepAspectRatio); m_animatedImage->setScaledSize(m_pixmap.size()); } + m_pixmap.setDevicePixelRatio(devicePixelRatio()); update(); } |
