From 732e0ec94e2ba5a33930c34f031a13f4767cbb7d Mon Sep 17 00:00:00 2001 From: David Rosca Date: Wed, 27 Jan 2016 12:26:30 +0100 Subject: [PATCH] TabIcon: Fix rendering for Qt 5.6 HighDPI --- src/lib/tabwidget/tabicon.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/tabwidget/tabicon.cpp b/src/lib/tabwidget/tabicon.cpp index e720d45bf..97bc47c1c 100644 --- a/src/lib/tabwidget/tabicon.cpp +++ b/src/lib/tabwidget/tabicon.cpp @@ -101,7 +101,8 @@ void TabIcon::paintEvent(QPaintEvent* event) QPainter p(this); - const int size = 16 * m_animationPixmap.devicePixelRatio(); + const int size = 16; + const int pixmapSize = size * m_animationPixmap.devicePixelRatioF(); // Center the pixmap in rect QRect r = rect(); @@ -111,7 +112,7 @@ void TabIcon::paintEvent(QPaintEvent* event) r.setHeight(size); if (m_animationRunning) - p.drawPixmap(r, m_animationPixmap, QRect(m_currentFrame * size, 0, size, size)); + p.drawPixmap(r, m_animationPixmap, QRect(m_currentFrame * pixmapSize, 0, pixmapSize, pixmapSize)); else p.drawPixmap(r, m_sitePixmap); }