1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 09:32:12 +01:00

TabIcon: Fix rendering for Qt 5.6 HighDPI

This commit is contained in:
David Rosca 2016-01-27 12:26:30 +01:00
parent 06c3778753
commit 732e0ec94e

View File

@ -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);
}